http://www.perlmonks.org?node_id=192724


in reply to Why does my subroutine not receive the scalar parameter as $_?

You are so close on this one - From perlsub ...

Any arguments passed to the routine come in as the array @_. Thus if you called a function with two arguments, those would be stored in $_[0] and $_[1]. The array @_ is a local array, but its elements are aliases for the actual scalar parameters.

So, if you are wanting to access the passed parameters directly, you will want to use $_[0] or alternately shift off values from the @_ array. eg.

sub get_long_count { my ($dd, $mon, $yyyy, $bc) = split /-/, $_[0], 4;