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.