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

Re: References with hashes

by chargrill (Parson)
on Feb 15, 2007 at 04:50 UTC ( #600133=note: print w/replies, xml ) Need Help??

in reply to References with hashes

This simple change gets your program closer to working:

#!/usr/bin/perl use strict; use warnings; my %address; $address{Bray} = { Name => 'Braden Mailloux', Str => 'kapellenstr. 1', EMail => '' }; my $email = $address{Bray}->{EMail}; print_address($address{Bray});

After this change, running it only gives the error "Undefined subroutine &main::print_address called at line 17."

You could also do this:

#!/usr/bin/perl use strict; use warnings; my %address = ( Bray => { Name => 'Braden Mailloux', Str => 'kapellenstr. 1', EMail => '' }); my $email = $address{Bray}->{EMail}; print_address($address{Bray});

I believe it has something to do with the hash key not existing as you're trying to declare it lexically, but I couldn't find anything concrete (to me) in the docs. See my and perlsub for more details.

s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://600133]
[Eily]: I still don't understand how the Turkish AA fit into the German+Czech joke though :P
[LanX]: new Firefox + cb sidebar do random auto expand on submit
[LanX]: probably need to start pm discussion
[LanX]: they have a constitutional referendum in turkey, kind of "do you want a dictator" and everybody opting no gets problems ...
[Corion]: LanX: Random Auto Expand?

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2017-03-27 12:11 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (319 votes). Check out past polls.