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 ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-20 05:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found