Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


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...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://697554]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-03-28 08:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found