Help for this page

Select Code to Download


  1. or download this
    sub double_it {
       return join ' ', $_[0] =~ /\w(?=\w(?<=(..)))/g;
    }
    
  2. or download this
    sub double_it {
       local ($_) = @_;
    ...
              map { $chars1[$_] . $chars2[$_] }
              0..$#chars1;
    }
    
  3. or download this
    sub double_it {
       local ($_) = @_;
    ...
    
       return join(' ', @pairs);
    }
    
  4. or download this
    sub double_it {
       our @pairs; local *pairs;
       () = $_[0] =~ /(\w)(?=(\w))(?{ push(@pairs, "$1$2"); })/g;
       return join(' ', @pairs);
    }