C
Chris Vidal
Lets say I have a ascii text file named sumfil and its contents are as
follows :
1
2
3
a
b
c
I dont want to act on any line before the line containing "a". The below
doesnt work. I sit at the command line I think in an infinite loop.
#! /opt/perl5/bin/perl
$tfil = "sumfil";
open (IN, "$tfil") or die;
while (defined($line = <IN>)) {
until ($line =~ "3") {
next;
} # end until
chomp $line;
print "$line\n"
} #end while
follows :
1
2
3
a
b
c
I dont want to act on any line before the line containing "a". The below
doesnt work. I sit at the command line I think in an infinite loop.
#! /opt/perl5/bin/perl
$tfil = "sumfil";
open (IN, "$tfil") or die;
while (defined($line = <IN>)) {
until ($line =~ "3") {
next;
} # end until
chomp $line;
print "$line\n"
} #end while