Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by AlexTape (Monk)
on Oct 09, 2013 at 08:36 UTC ( [id://1057509]=note: print w/replies, xml ) Need Help??


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

after fixing the brackets like choroba introduced,
i would access and travel the hash like this..
#!"C:\perl\bin\perl.exe" -w # pragma use strict; use warnings; use diagnostics; # includes use Data::Dumper; use Data::Diver qw( Dive ); # data my ( $tgs, %tgs ); %tgs = ( 'articles' => { 'Java' => 'How to Program in Java', 'Perl' => 'Perl Programming for Biologists', 'Python' => { 'Programming' => q/Expert's Guide to +Scala/, }, }, 'eBooks' => { 'Linux' => q/Linux: A Beginner's Guide/, }, ); $tgs = \%tgs; # dive hash print Dumper $tgs->{articles}->{Python}->{Programming}; # returns: # # $VAR1 = 'Expert\'s Guide to Scala'; # # or # print Dumper Dive( $tgs, qw ( articles Python Programming ) ); # returns: # # $VAR1 = 'Expert\'s Guide to Scala'; 1;
kindly perlig

$perlig =~ s/pec/cep/g if 'errors expected';
  • Comment on Re: A "simple" question regarding accessing a value in a complex data structure.
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-24 01:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found