Help for this page

Select Code to Download


  1. or download this
      DB<163> map { ($a,$b)=split /\s+/; $hash{$a}{$b}=1 } <I>;
     => (1, 1, 1, 1)
    
      DB<164> \%hash
     => { Canberra => { 12 => 1, 18 => 1 }, Sydney => { 12 => 1, 14 => 1 }
    + }
    
  2. or download this
      DB<143> $hash{$_->[0]}{$_->[1]} = 1 for map { [split /\s+/] } <I>
     => ""
    
      DB<144> \%hash
     => { Canberra => { 12 => 1, 18 => 1 }, Sydney => { 12 => 1, 14 => 1 }
    + }