arunhorne has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I'm reading a file such that once a certain condition is met, I want to skip forward 6 lines in the file. I though what I'd written below would work but it doesn't... how do I do this... What I want is for the final (6th) line to be in $_ once have skipped forward... Thanks.
____________open DIFF, "<$diff_file" or print $query->p("Couldn't open $diff_file" +); while (<DIFF>) { if (m/Cluster (\d+)/) { my $num = $1; # Read 6 lines; <DIFF>;<DIFF>;<DIFF>;<DIFF>;<DIFF>;<DIFF>; #my @ecs = split /, /; $clust_hash{$num} = $_;#\@ecs; } } close DIFF;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: skip forward through file
by Abigail-II (Bishop) on Jul 04, 2002 at 13:05 UTC | |
|
•Re: skip forward through file
by merlyn (Sage) on Jul 04, 2002 at 14:35 UTC | |
by Abigail-II (Bishop) on Jul 04, 2002 at 14:50 UTC | |
by broquaint (Abbot) on Jul 04, 2002 at 15:04 UTC |