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

Re: passing $_ to my function

by blm (Hermit)
on Sep 30, 2002 at 14:06 UTC ( [id://201718]=note: print w/replies, xml ) Need Help??


in reply to passing $_ to my function

I usually use

sub my_sub { my ($arg1, $arg2) = @_; ... }

in my functions. So the equivalent of these would be:

sub my_sub { my ($arg1, $arg2) = @_ ? @_ : $_; ... }
Is this reasonable?
--blm--
If you don't like this post can you please /msg me

Log In?
Username:
Password:

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

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

    No recent polls found