Help for this page

Select Code to Download


  1. or download this
    my @col = split /;/;
    push @col, '' for @col .. 2;
    print join ';', @col;
    
  2. or download this
    my $len = 3;
    print join ';', (split(/;/), ('') x $len)[0 .. $len-1];
    
  3. or download this
    my %foo =
      map { (split /:/, $_, 2)[0, 1] } # Implicit "default" undef.
    ...
              'foo' => 'bar',
              'zip' => 'zap:zoom'
            };
    
  4. or download this
    my %foo = map { split /:/ } ...;