Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Help needed understanding global variables in Perl

by broquaint (Abbot)
on Mar 05, 2002 at 10:44 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://149325]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found