Slash Boxes
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.
More | Login | Reply
Loading... please wait.
  • sub zip {
        my( $a, $b ) = @_;
        my $res;
        $res .= chop($b).chop($a) for 1..length($a);
        scalar(reverse $res);
    • Nice. We all forget chop :-)
      • I long ago proposed, on perl5-porters, an operator "chip" that would take one char from the front of a string, the way chop takes a character from the end. That would get around the need to reverse the chopped together $res.
        • Chip sounds cool... can remember computer chips but also food O:-)

          During our discussion about an "interesting" solution, we could take advantage of chip. We thought of unshift, but that doesn't work for arrays.

          • The computer chip I referred to in the original proposal was Chip Salzenburg, who was working on Topaz (the original potential perl6) at the time, had established The Perl Foundation, and was the original pumpking (after Larry), so sneaking an honorarium mention of him into the language seemed reasonable.