I thought that the variable @_ would take whatever was passed to it,
even for a subroutine without any explicit arguments?
Thing is that if you declare sub convert () {...} you're telling
Perl that the routine takes no arguments... In other words, if
you're then going to call the routine with any arguments, you'll just
get the error Too many arguments for main::convert ...
Without any prototype, however, Perl already does exactly what you
want, i.e. you can pass one or several arguments...
| [reply] [d/l] [select] |
even for a subroutine without any explicit arguments
I don't know where you got the term explicit or what you want it means in this context, but what almut meant was that the "()" in "sub foo () { ... }" means the subroutine takes no arguements. Drop the "()": "sub foo { ... }".
Update: Too slow and credited the wrong monk. Fixed the latter.
| [reply] [d/l] [select] |