Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Parsing text file question

by integral (Hermit)
on Jun 28, 2004 at 08:27 UTC ( #370144=note: print w/ replies, xml ) Need Help??


in reply to Re: Parsing text file question
in thread Parsing text file question

How about using redo and a c-style for loop?

my (@array, $i); @array = <FILE>; for ($i = 0; $i <= $#array; $i++) { if ($i > 0 and $array[$i] =~ /\bfail\b/) { splice @array, $i - 1, 1; redo; } }

--
integral, resident of freenode's #perl


Comment on Re^2: Parsing text file question
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://370144]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2014-08-29 00:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (275 votes), past polls