foreach my $g (@gists) { for my $filename( keys(%{$g->{files}}) ) { my $fref = $g->{files}{$filename}; # Simplify access to contents ..( -> is optional betweeen "}{" ) print $fref->{raw_url}; last; # If you only want info for ONE file } }