foreach my $friendref ( @{ $VAR1->{ut_response}[0]{friend_list}{friend} } ) { print "Hi $friendref->{user}\n"; }