Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 wandering the Monastery: (9)
As of 2015-07-30 10:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls