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

Re: A "simple" question regarding accessing a value in a complex data structure.

by Anonymous Monk
on Oct 09, 2013 at 07:45 UTC ( #1057498=note: print w/replies, xml ) Need Help??


in reply to A "simple" question regarding accessing a value in a complex data structure.

The odd number of hash elements warnings arises from the fact that there is only one key? Thanks

Yes, a key without a value, specifically  { q/Expert's Guide to Scala/ },

my $hashref = { 'hasherefs', 'are', 'made', 'with', 'curly', 'braces', 'they', 'like', 'to', 'come', 'in', 'pairs' };

Here is another way to initialize , the rehohy way

my %tgs; $tgs{articles}{Python}{Programming}{"Expert's Guide to Scala"} = undef; #d3 $tgs{articles}{Perl} = "Perl Programming for Biologists"; #d1 $tgs{articles}{Java} = "How to Program in Java"; #d1 $tgs{eBooks}{Linux} = "Linux: A Beginner's Guide"; #d1

And wouldn't you know it, its also a way to access certain elements :)

See also references quick reference

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2019-12-08 07:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?