while: one supresses the other?

2012-03-12 Thread oxy
Hi, i have the following file content: numbers = one two three four I run the code: = begin code == #!/usr/bin/perl -w $AG2 = non; $AG3 = non; open (file , "){if (/(.*)\s*=\s*.*three.*/) {$AG3 = $1} else {$AG3 ='not found 3'};}; while(){if (/(.*)\s*=\s*.*three.*/)

while: both syntaxes cant solve my problem

2012-03-13 Thread oxy
hi all, I have a problem with the following structure: while(){$thevariable=$1 if (/variable1=(.*)/)}; Now I wanna be sure that variable1 was really set in the above statement (it could have an old value from a previous embracing loop). Then I tried: while(){if (/variable1=(.*)/) {$thevari