Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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 taking refuge in the Monastery: (13)
As of 2014-09-22 16:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls