Help for this page

Select Code to Download


  1. or download this
    Bilbo Baggins, Under The Hill
    Sam Gamgee, Bagshot Row
    
  2. or download this
    1 #!/usr/bin/perl
    2 
    ...
    10 # print out that hash
    11 
    12 print "$_ => $hash{$_}\n" for keys %hash;
    
  3. or download this
    Bilbo Baggins => Under The Hill
    Sam Gamgee => Bagshot Row
    
  4. or download this
    while (my $line = <I>) {
        chop $line;
    ...
        my ($name, $addr) = split /\s*,\s*/,$_,2;
        $hash{$name} = $addr;
    }
    
  5. or download this
    while (my $line = <I>) {
        chop $line;
        my ($name, $addr) = split /\s*,\s*/,$_,2;
        $hash{$name} = $addr;
    }