Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Aliasing Module->method

by stevieb (Canon)
on Feb 06, 2016 at 19:23 UTC ( [id://1154577]=note: print w/replies, xml ) Need Help??


in reply to Aliasing Module->method

First off, the confusion later down the road by using my code below isn't remotely close to being worth saving a few keystrokes, but to answer your question, you can use a typeglob, and wrap the call within an anonymous sub. Note how I pass in the parameters (@_) through the anonysub and directly into the original call:

use warnings; use strict; use Time::Piece; *st = sub { Time::Piece->strptime(@_) }; st("Sunday 3rd Nov, 1943", "%A %drd %b, %Y",);

Replies are listed 'Best First'.
Re^2: Aliasing Module->method
by gerases (Sexton) on Feb 06, 2016 at 23:10 UTC
    Ahhh... Cool!! Thank you for such a quick response.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1154577]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-19 04:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found