in reply to Fun with arrays and hashes
2. and 3.use Storable; store (\@array, "/path/to/array.dat"); my @newarray = @{retrieve("/path/to/array.dat")};
while(<>) { /^(.+)\: (.+)$/; my $key = $1 my @values = split(", ", $2); $hash{$key} = \@values; } foreach my $key (sort keys %hash) { print "$key: ", join(", ", @{$hash{$key}}), "\n"; }
|
|---|