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

Re: Passing with $_ instead of @_ in anonymous subs

by stefp (Vicar)
on Oct 28, 2002 at 09:05 UTC ( [id://208470]=note: print w/replies, xml ) Need Help??


in reply to Passing with $_ instead of @_ in anonymous subs

$_ is visible within your methods. All you have to add at the beginning of your method is:

@items = ($_) unless @items;
But you can't expect to behave so as to automagically modify $_ if you modify $_[0].

-- stefp -- check out Nemo

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2024-04-19 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found