nmretd
Oct 16th, 2001, 11:03 AM
I have the following code:
while (<INFILE> ) {
print OUTFILE;
}
The above code reads every line in my INFILE and writes it to the OUTFILE and works fine, but when I change it to the following it doesn't write anything to my OUTFILE ?
while (<INFILE> ) {
if ($_ eq "yes") {
print "$_";
print OUTFILE;
}
}
I only want to write those records to my outfile where the record ($_) = yes.
while (<INFILE> ) {
print OUTFILE;
}
The above code reads every line in my INFILE and writes it to the OUTFILE and works fine, but when I change it to the following it doesn't write anything to my OUTFILE ?
while (<INFILE> ) {
if ($_ eq "yes") {
print "$_";
print OUTFILE;
}
}
I only want to write those records to my outfile where the record ($_) = yes.