Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: arrays and hashes blended !

by osunderdog (Deacon)
on Sep 29, 2005 at 13:35 UTC ( #496099=note: print w/replies, xml ) Need Help??

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.



Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://496099]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2020-12-05 09:48 GMT
Find Nodes?
    Voting Booth?
    How often do you use taint mode?

    Results (63 votes). Check out past polls.