foreach my $test (@a) { if ($test->{hello} != 1) { function($1, $2, $3); print "hello\n"; } }