Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Package Variables

by ELISHEVA (Prior)
on Mar 28, 2011 at 04:00 UTC ( #895831=note: print w/ replies, xml ) Need Help??


in reply to Re: Package Variables
in thread Package Variables

Minor correction - my is block scoped (or more technically speaking "lexically" scoped) with the largest containing "block" (lexical unit) being the file. Example:

use strict; use warnings; package Goo; my $x=100; print "package=", __PACKAGE__, " x=$x\n"; package Boo; { my $x=200; print "package=", __PACKAGE__, " x=$x\n"; } package Foo; print "package=", __PACKAGE__, " x=$x\n"; #outputs package=Goo x=100 package=Boo x=200 package=Foo x=100


Comment on Re^2: Package Variables
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2015-07-31 02:11 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 (274 votes), past polls