Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Scope, package, and 'my' variables

by demerphq (Chancellor)
on Jan 04, 2005 at 18:32 UTC ( [id://419358]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!perl -l
    my $foo='$foo';
    ...
    print $foo;    #prints '$foo'
    package Baz;
    print $foo;   #prints '$foo'
    
  2. or download this
    *main::package_var=\(my $lexical_var); 
    $lexical_var='foo'; 
    print $main::package_var; #prints 'foo'
    

Log In?
Username:
Password:

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

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

    No recent polls found