in reply to Re: passing $_ to my function
in thread passing $_ to my function

That breaks if you pass an argument that evaluates as false. I'd do something like this:

sub my_sub { my $arg = @_ ? shift : $_; # do stuff }
--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg