Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: nuances of my, and maybe local

by Chmrr (Vicar)
on Sep 27, 2002 at 17:25 UTC ( #201272=note: print w/ replies, xml ) Need Help??


in reply to nuances of my, and maybe local

Read Coping with Scoping by Dominus for the skinny on my vs local. The node I need a simple explantion of the difference between my() and local() is a long discussion on the topic, as well.

Myself, I seldom use the form of my with parens -- mostly because I create my variables when I need them. If I need a whole bunch of them at once, it's probably because I want the list context, such as at the top of subroutines:

sub foo { my ($bar, $baz, $troz) = @_; ... }

perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'


Comment on Re: nuances of my, and maybe local
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (13)
As of 2015-07-06 12:27 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 (74 votes), past polls