Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Scoping Variables

by stuffy (Monk)
on May 18, 2001 at 08:08 UTC ( [id://81430]=note: print w/replies, xml ) Need Help??


in reply to Re: Scoping Variables
in thread Scoping Variables

while (<NEW_HIST>){ /^(\w{3}\s+\w{3}\s+\d{1,2})/; my $pass_down_date = $1 if (/$tool/){ print "$pass_down_date"; $print_checker = 1; } if (/$stop/){ $print_checker = 0; } if ($print_checker){ print "$_ <br>\n"; } }

this is the actual code in the loop. $pass_down_date is being matched, it will print outside of any of the if loops. If I try to print it out inside any of the if loops, it comes back with what I believe is an empty string.
by the way, strict and -w are on. :)

Stuffy

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-19 22:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found