Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Is this really random?

by Jenda (Abbot)
on Nov 22, 2012 at 15:19 UTC ( #1005148=note: print w/ replies, xml ) Need Help??


in reply to Re: Is this really random?
in thread Is this really random?

Overriding prototypes is not all it does!

sub foo { print "Called foo(" . join(',', @_) . ")\n"; } sub bar { print "Called bar(" . join(',', @_) . ")\n"; print "foo(); : "; foo(); print "&foo; : "; &foo; } bar(1,2,3);

Jenda
Enoch was right!
Enjoy the last years of Rome.


Comment on Re^2: Is this really random?
Download Code
Replies are listed 'Best First'.
Re^3: Is this really random?
by tobyink (Abbot) on Nov 22, 2012 at 15:47 UTC

    Also don't forget &foo() which overrides prototypes without the effect of passing along the caller's @_.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (21)
As of 2015-07-28 14:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (255 votes), past polls