Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • 5.12 will support each on arrays. So that would be:

    while (my ($num, $line) = each @foo) {
      if ($line =~ /corge/) {
        $bar{$num} = $line;
      }
    }

    You can have this right now with Aaron Crane's Array::Each::Override [cpan.org].

    • Lovely! And not even another hard-to-remember symbol, so even better. I'll look forward to having it around in the core.
    • ...and really, that's much better, because otherwise you'd have to constantly copy $ into a lexical for nested loop. Too much vertical space taken!
      --
      rjbs