sub abc { my ($x) = @_; my $z; foreach my $y (@{ $x }) { # do xxx # on # lots # of # lines } return $z; }