Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Hash element access -dereferenced hashes

by reaper9187 (Scribe)
on Dec 06, 2012 at 10:35 UTC ( #1007525=note: print w/ replies, xml ) Need Help??


in reply to Hash element access -dereferenced hashes

the above codes work just fine.. dunno whats wrongs with the exp .. i'll post the code .. c if u can figure out the problem
i have two defined hashes cell and map,

$a = "Lucy"; my %cell=> = ( Lucy => '12' ); my %map=> = ( 12 => '45' );

i try printing it using the command
print "$cell{$map{$a}}\n";
but it throws the exception-- use warnings: - use of uninitialized value within %cell in string at line...


Comment on Re: Hash element access -dereferenced hashes
Select or Download Code
Re^2: Hash element access -dereferenced hashes
by choroba (Canon) on Dec 06, 2012 at 10:53 UTC
    syntax error at ./1.pl line 2, near "=> ="
    Please, post the real code.

    After fixing that, just switch the hashes. $map{Lucy} does not exist.

    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2015-07-04 17:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls