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.
  • The reason I wrote it as
    s/-/ /g for @array;
    instead of
    for ( @array ) {
        s/-/ /g;
    }
    was not to save keystrokes, but to put the interesting part of the code first. I think of how I'd say it in English:
    Change any dashes to spaces throughout the list
    instead of
    Throughout the list, change any dashes to spaces
    I think about that a lot. That's why I like the "open or die" metaphor instead of what I see as entirely backwards "die unless open".
    --

    --
    xoa