Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Parsing barewords as sub/method calls? (workaround)

by Eily (Hermit)
on Nov 23, 2013 at 17:21 UTC ( #1064052=note: print w/ replies, xml ) Need Help??


in reply to Re: Parsing barewords as sub/method calls? (workaround)
in thread Parsing barewords as sub/method calls?

&BLA; is actually equivalent to BLA(@_);. This works in your case because @_ is empty, but if you use this syntax within a sub, you'll forward its arguments.

use feature 'say'; @_ = qw/4 5 6/; our $AUTOLOAD; sub AUTOLOAD { say "Autoload called as $AUTOLOAD(@_)" } BLA(1,2,3); &BLA; __END__ Autoload called as main::BLA(1 2 3) Autoload called as main::BLA(4 5 6)


Comment on Re^2: Parsing barewords as sub/method calls? (workaround)
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (15)
As of 2014-09-18 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (116 votes), past polls