Use $_[0] (the first element of @_) instead of $_.
See perlman:perlsub Description for explanation.
In reply to Re: Why does my subroutine not receive the scalar parameter as $_?
by BrowserUk
in thread Why does my subroutine not receive the scalar parameter as $_?
by @ncientgoose
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |