Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: What is %_

by guice (Scribe)
on May 16, 2000 at 02:25 UTC ( #11763=note: print w/ replies, xml ) Need Help??

in reply to What is %_

Well, I'm not totally sure what sets %_ myself, but I have found out that you can use %_.
Just don't 'my' it:

&mySub(); sub mySub{ my %Defaults = (Name => 'Russ', Job => 'Programmer', Language => 'Perl'); local %_ = (%Defaults, @_); # Warning, this does not compile! ### #(Now use %_ as my argument list) ### print "The name is: $_{Name}\n"; }
That works perfectly fine. It would be intersting to see if there is an internal perl action/method/function that will actually set %_, like it does with $_ and @_;

Any takers?

-- philip
We put the 'K' in kwality!

Comment on Re: What is %_
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2015-11-26 04:55 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (696 votes), past polls