Don't ask to ask, just ask | |
PerlMonks |
Re^3: Corrupt Data?by almut (Canon) |
on Jul 14, 2008 at 20:13 UTC ( [id://697554]=note: print w/replies, xml ) | Need Help?? |
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...
In Section
Seekers of Perl Wisdom
|
|