Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

by Eily (Curate)
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: (6)
As of 2015-08-30 04:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (346 votes), past polls