http://qs321.pair.com?node_id=1057509


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';