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 , "<inpfile.txt");
while(<file>){if (/(.*)\s*=\s*.*three.*/) {$AG3 = $1} else {$AG3 ='not
found 3'};};
while(<file>){if (/(.*)\s*=\s*.*three.*/) {$AG2 = $1} else {$AG2 ='not
found 2'};};
print "AG2 is $AG2----------------------AG3 is $AG3 -------------\n";
================ end code ========================
Now, only the first while command will be read. The second is ignored.
Change the order of the lines and the same happens.
??????? Any idea?
tx
Thread Next