Results 1 to 2 of 2

Thread: Perl - foreach

  1. #1
    Senior Member SJP's Avatar
    Join Date
    Aug 2003
    Location
    Orcas, Wa
    Posts
    205

    Default Perl - foreach

    Is it possible to tell where the current pointer is at in a foreach loop so you can do another foreach from that point? Or in other words a foreach loop inside a foreach loop where the inner loop picks up from where the outer loop left off?

    foreach my $p (@lines) {
    .
    .
    foreach my $q (the next line $p would have gotten) {
    .
    .
    }
    }

    thanks, SJP

  2. #2
    Senior Member SJP's Avatar
    Join Date
    Aug 2003
    Location
    Orcas, Wa
    Posts
    205

    Default

    Well I knew I'd find the answer in the Perl bible (Programming Perl 3rd Edition) I just didn't know where to look. The answer to my question - no. The only way to make do is by using ugly for loops with array indices.

    SJP

Similar Threads

  1. Replies: 4
    Last Post: 05-25-2007, 01:18 PM
  2. Installing Perl GD module with CPAN
    By sonavor in forum CGI Scripts / Perl
    Replies: 15
    Last Post: 10-12-2006, 03:12 AM
  3. Installing Bugzilla on a WestHost VPS
    By sonavor in forum CGI Scripts / Perl
    Replies: 0
    Last Post: 03-28-2006, 11:43 PM
  4. New Perl at WestHost: Perl vs. ActiveState Perl?
    By WestHost - TErnstrom in forum Comments / Suggestions
    Replies: 15
    Last Post: 01-25-2006, 06:40 PM
  5. Installing Perl modules with CPAN
    By jalal in forum CGI Scripts / Perl
    Replies: 19
    Last Post: 11-03-2005, 10:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •