Help for this page

Select Code to Download


  1. or download this
    my @first = qw/ one-1 two-2 three-3/;
    my %hash  = map { split /-/ } @first; # Which works for me btw
    print map { "$_ => $hash{$_}\n" } keys %hash;
    
  2. or download this
    my @first = qw/ one-1 two-2 three-3/;
    my @second  = map { split /-/ } @first;
    my %hash = @second;  # Legal code, isn't it?
    print map { "$_ => $hash{$_}\n" } keys %hash;
    
  3. or download this
    @second = @first;