in reply to Getting values for next array iteration when matching current

for( my $ix = 0; $ix < @ref; $ix++ ){ my $it = $ref[$ix]; if( $it =~ m/$in/i ){ print OUT $it,$ref[$ix+1]; } }

Replies are listed 'Best First'.
Re^2: Getting values for next array iteration when matching current
by naturalsciences (Beadle) on Mar 20, 2011 at 08:58 UTC
    DAMN now im blinded by light!!! Thank you very much - guess it was too obvious solution.

    edit : after euphoria :D On the other hand with the foreach loop gone the code will not check the pattern $in from the filehandle and match it with every individual line in array @ref. It will start checking if the first element in array @ matches the pattern of the first line from filehandle second from second etc. Which doesn't work for me - maybe if I'll load the filehandle <IN> into an array and to a foreach from there.