Others have already answered your more immediate question, but from the way you asked, it looks like you may have a misconception about how subroutine parameters work in the first place.
All that passing parameters to a subroutine call does, is to make those values available to the subroutine in the special @_ array.
It does not automatically make each parameter a variable inside the subroutine, and in fact it won't have any effect at all if the subroutine does not choose to look at the contents of @_.
Often, "looking at the contents of @_" is done implicitly using calls to shift, hence the my $candidate = shift; in the above answer.
If you need more explanation, please read perlintro#Writing-subroutines.
In reply to Re: Problem with parameters in subroutines
by smls
in thread Problem with parameters in subroutines
by aatrox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |