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

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

by Eily (Vicar)
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)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2016-10-28 22:20 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (387 votes). Check out past polls.