Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: arrays and hashes blended !

by osunderdog (Deacon)
on Sep 29, 2005 at 13:35 UTC ( [id://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.

    Kudos

    Prad

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (9)
As of 2024-04-19 08:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found