Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Duh. 'my' scope in if else blocks.

by Thilosophy (Curate)
on Dec 11, 2007 at 11:14 UTC ( [id://656376]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if ( my $t = shift ) { 
       $t =~ s/change_something/to_something_else/;
    } 
    print "$t\n";   # out of scope here
    
  2. or download this
    print $t if (my $t = shift);
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-03-29 13:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found