foreach $row (@array) { &routine($row); } sub routine { if ($row != '10') { print "stuff"; } else { next; } }