Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Thanks for looking!... open my $fh, '<', 'data.txt' or die "can't open config file: $!"; my @config = YAML::LoadFile($fh); #print Dumper(@config); for my $record (@config) { my $cities = "$record->{'xml_api_reply'}{'weather'}{'forecast_inf +ormation'}{'city'}->{'-data'}"; my $currwind ="$record->{xml_api_reply}->{weather}->{current_cond +itions}->{wind_condition}->{'-data'}" || ''; #for my $subrecord (@{$record->{Field2}}) { #print "\t$subrecord->{Key} = $subrecord->{Val}\n"; #} print "**$cities*$currwind*\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Not a HASH reference using YAML
by tobyink (Canon) on Aug 17, 2012 at 06:12 UTC | |
by Anonymous Monk on Aug 17, 2012 at 14:39 UTC | |
by tobyink (Canon) on Aug 17, 2012 at 15:10 UTC | |
|
Re: Not a HASH reference using YAML
by rpnoble419 (Pilgrim) on Aug 17, 2012 at 05:53 UTC |