in reply to Strange behavior by Perl: Too many arguments for...
Your second example is the other way way round. The compiler sees your definition, and its prototype - the empty brackets before the brace in "_validate() {". That prototype says that _validate must be called with no arguments. However, your subroutine call has one argument: $login.
Removing the empty parentheses from your function definition will solve your problem:
sub _validate {
|
|---|