in reply to Taken out of Context

I always considered it good practice to stick an explicit plain return in every sub that’s not meant to have an actual return value, in order to avoid random stray bits traveling around unexpectedly. Your meditation just gives me another reason for the practice.

FWIW, I’m not sure why you thought map would be easier than foreach. You have more control over the latter (you can use next and last, whereas with map you have to clumsily produce an empty list in order to skip a value and can’t abort early at all).

PS.: your title gave away the riddle prematurely…

Makeshifts last the longest.

Replies are listed 'Best First'.
Re^2: Taken out of Context
by liverpole (Monsignor) on Jul 25, 2006 at 12:26 UTC
    Hi Aristotle,

        I’m not sure why you thought map would be easier than foreach.

    Originally I didn't have a foreach, it was actually just a for (my $i = 32; $i < 127; ++$i).  That's why I said "... basically something like this ..."  I modified it later to have a similar "look" as the (almost) equivalent map construct.

    And your point about "next" and "last" is both correct and ironic, because the first thing that happened when I switched to map was that I ran into the problem of next not being usable and having to be written differently, which reminded me of this recent question.


    s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/