Works OK for me:
#! perl use strict; use warnings; my @gists = ( { files => { 'main.html' => { language => 'HTML', filename => 'main.html', type => 'text/html', size => 713, raw_url => 'THIS IS WHAT I WANT' } } } ); foreach my $g (@gists) { my @files = keys(%{$g->{files}}); my $file = $files[0]; print $g->{files}->{$file}->{raw_url}; }
Output:
21:28 >perl 472_SoPW.pl THIS IS WHAT I WANT 21:28 >
The only difference a dot in the hash key makes is that the key has to be quoted under use strict.
Can you provide a minimal example that demonstrates the problem you are seeing?
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: can't use certain hashnames when traversing a slightly complex hash
by Athanasius
in thread can't use certain hashnames when traversing a slightly complex hash
by gideondsouza
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |