in reply to promoting array to a hash
use strict; my @friends = ("noc", "john", "brightland", "christine", "marsh", "bra +ndon"); # create hash from array my %friends = @friends; foreach my $entry (keys %friends) { print "Company $entry has buddy $friends{$entry}\n"; } __OUTPUT__ Company brightland has buddy christine Company marsh has buddy brandon Company noc has buddy john
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: promoting array to a hash
by davido (Cardinal) on Jun 13, 2004 at 05:33 UTC | |
by hsinclai (Deacon) on Jun 13, 2004 at 14:22 UTC |