Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: Scoping Variables

by stuffy (Monk)
on May 18, 2001 at 08:08 UTC ( #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
Node Status?
node history
Node Type: note [id://81430]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2018-07-17 06:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (355 votes). Check out past polls.

    Notices?