Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2014-10-02 12:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (56 votes), past polls