Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: trouble regexing the next line

by Kenosis (Priest)
on Jul 28, 2012 at 15:20 UTC ( #984208=note: print w/replies, xml ) Need Help??

in reply to trouble regexing the next line

If you use Tie::File;, you can tie the file to an array, and then iterate over the array's elements (i.e., the file's lines) using something like for(my $i = 0; $i < scalar @array; $i++){ ... }, looking for a pattern match in each $array[$i], where $array[$i+1] would be the next line in the file (provided $i+1 < scalar @array).

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2016-10-28 00:45 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (373 votes). Check out past polls.