Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Aliasing Module->method

by stevieb (Abbot)
on Feb 06, 2016 at 19:23 UTC ( #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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1154577]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2018-07-19 08:22 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (404 votes). Check out past polls.