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.
  • couldn't you write…

    my @reversed = induce { @$_ ? pop @$_ : end_of_fold } [ 1 .. 10 ];

    …and have end_of_fold undef $_?

    If you used a different localised variable, you might also be able to unfold undef values. But I don't really know if that is wanted.

    --phaylon

    --
    Ordinary morality is for ordinary people. -- Aleister Crowley
    • That makes it seem like the end_of_fold function is somehow special. I’d prefer people who use this to understand exactly how it works, and avoiding low-gain abstractions helps.