Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 musing on the Monastery: (7)
As of 2015-07-05 19:35 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 (67 votes), past polls