in reply to Re^2: Corrupt Data?
in thread Corrupt Data?
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...
|
|---|