Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by stefp (Vicar)
on Oct 28, 2002 at 09:05 UTC ( #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
Node Status?
node history
Node Type: note [id://208470]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2021-02-27 04:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?