sharan has asked for the wisdom of the Perl Monks concerning the following question:
from which i have to read some data I am trying to check only for condition 2 and thus to get the output:data1; if(some condition1 = 1) then read this data 2; end if; if (some condition2 = 0) then read this data 3; read data 4; end if; if(some condition3 = 11) then read this data 5; data 6; end if; if (some condition2 = 0) then read this data 6; end if;
I wrote a prog to read the only condition 2 and try to read multiple files as:read this data 3; read data 4; read this data 6;
Am not able to read the desired output lines nor able to read multiple files. If a write a file name eg open(WORDLIST, <test.doc>); then am able to access one file at a time. Could u guys please help me.. Thanking u in advance...open(WORDLIST, <*.doc>); while(<WORDLIST>) if(/if/) { if(/condition 2/) {print "$_"; } else{} } open(WORDLIST);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: read different loops
by toolic (Bishop) on Nov 17, 2008 at 20:01 UTC | |
|
Re: read different loops
by Perlbotics (Archbishop) on Nov 17, 2008 at 20:15 UTC |