Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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.

    Kudos

    Prad

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2020-05-30 15:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (173 votes). Check out past polls.

    Notices?