On Aug 23, Gary Luther said:

>foreach $lines (@rename) {
>  do a bunch of stuff here
>  now I need to read the next line to get some info
>  that needs to be processed with the first line info
>  I want to be able to do something like???
>  $line2=<@rename>;
>  do some stuff on $line2
>  write out some stuff
>}

It sounds like you want to use a C-style loop, or else do some CRAZY
hoop-jumping:

  for (my $i = 0; $i < @rename; $i += 2) {
    my ($first, $second) = @rename[$i, $i+1];
    # ...
  }

  # or:

  my $i = 0;
  for (@rename) {
    if ($i++ & 1) {
      # odd element ($rename[1], $rename[3], ...)
    }
    else {
      # even element ($rename[0], $rename[2], ...)
    }
  }

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to