I am parsing a rather large input file using the follow-
ing perl code:
while (my $line = <$fh>) { chomp($line); my ($uid, $login, $cpupr, $cpunpr, @data) = (split("\t",$line)); }
I want to stop parsing lines when a certain string is
found in the input file. Would anyone be able to
assist me in accomplishing this? I am able to use a
pattern match to determine when this string is found,
but I am not sure how to get perl to stop parsing lines
of input at this point. The pattern matching regular
expression is:
if ($line =~ /TOTAL COMMAND SUMMARY/)
I am putting this after 'split' line and before the
while loop ends.
I hope someone can tell me what to do in the block
associated with this if statement or maybe this should
be some other kind of control loop.
In reply to Terminating Read Of Input by rayv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |