Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Help needed understanding global variables in Perl

by broquaint (Abbot)
on Mar 05, 2002 at 10:44 UTC ( #149325=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # use strict;
    $foo = "a string";
    ...
        local $foo;
        print qq(foo is now localized and empty "$foo"\n);
    }
    
  2. or download this
    {   # creates a new lexical scope
        my $foo = "add text here - ";
    ...
            return $foo;
        }
    }   # $foo now only referenced by &add_text
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2015-02-28 20:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    On my keyboard, Caps lock is:








    Results (464 votes), past polls