Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Passing hash references

by bgreenlee (Friar)
on Jan 31, 2005 at 16:16 UTC ( [id://426639]=note: print w/replies, xml ) Need Help??


in reply to Passing hash references

One issue you have is that you're adding a level of indirection by passing a reference to $names to validateNames, but it's already a reference (to the %data hash). So just call &validateNames($names).

As for printing the data, you can do this:

for my $key (keys %$valid_names) { print "key: $key\n"; print " name: $valid_names->{$key}{name}\n"; print " email: $valid_names->{$key}{email}\n"; }

Finally, the places to look for more information on data structures and references are: perldata, perldsc, and perlref.

-b

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-25 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found