in reply to Printing different hash elements to different files
my %hash = ( one => "first bit", two => "second bit", ); # open files foreach my $file (keys %hash) { open $file, ">$file" or die "could not open $file: $!\n"; } # print elements foreach my $key (keys %hash) { print $key "$key => $hash{$key}\n"; }
-Mark
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Printing different hash elements to different files
by tilly (Archbishop) on Apr 16, 2004 at 01:20 UTC |