in reply to arrays and hashes blended !

No need to store values in an intermediate array.

use strict; my %new_hash_experiment = map {($_, undef)} qw(aa ab ac ad ae af); foreach my $key (sort(keys(%new_hash_experiment))) { print "\nEnter a value for key: $key: "; chomp($new_hash_experiment{$key} = <STDIN>); } foreach (sort keys %new_hash_experiment) { print "$_ contains $new_hash_experiment{$_}\n"; }

All your base are belong to us!

Hazah! I'm Employed!

Replies are listed 'Best First'.
Re^2: arrays and hashes blended !
by prad_intel (Monk) on Oct 03, 2005 at 06:08 UTC
    Thanks to all those

    Esp to osunderdog , the code he gave was the closest of what i exactly wanted.

    Well others , thanks i now have learnt a new lesson : Do not sumbit a code if there are some warnings and error in the code after using use strict or use warnings.. since that indicates a flaw in the logic.

    Kudos

    Prad