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