in reply to User-Defined Sub, Passing a Single Argument?

Note that Method #2 is buggy. You will not grab the argument, but the length of the argument array. You mean
sub myFunction { my ($arg) = @_; #blah blah blah, do some stuff..... } myFunction($myArg);
so that the assignment is in list context. See Context in perldata.

For my own work, I usually use

sub myFunction { my ($arg1, $arg2, ..., $argN) = @_; #blah blah blah, do some stuff..... } myFunction($myArg);
unless I'm writing an object method, in which case I use shift to get the reference:
sub myFunction { my $self = shift; my ($arg1, $arg2, ..., $argN) = @_; #blah blah blah, do some stuff..... } myFunction($myArg);
though, if it's just a quick and dirty iterator over a list, sometimes I skip stripping the argument array entirely:
sub myFunction { for (@_) { ... # lvalue; Note this impacts the passed values!! } } myFunction($myArg);
See also Best Practices(TM) reference card, noting that it doesn't weigh in.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.