Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: subroutine help

by Anonymous Monk
on Nov 30, 2012 at 20:28 UTC ( #1006517=note: print w/replies, xml ) Need Help??


in reply to subroutine help

The arguments to a subroutine are ... a list. If you "pass an array," Perl might flatten that array into a list of individual arguments. What you really want to do is to pass one argument to the subroutine, consisting of a reference to that array; an "arrayref." A reference (to anything...) is always "one thing." Be explicit about how you say this sort of thing to Perl, because Perl does try to "do what I mean (DWIM)" and is sometimes wrong. Also be sure to say use strict; use warnings; at the top of your module so that problems which might otherwise "helpfully" be ignored will be told to you.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1006517]
help
Chatterbox?
[LanX]: LOL
[choroba]: we used to play more :)
Discipulus played the guitar in a ska band 12 elemnts, very fun
[LanX]: well ... the prize for worshipping satan is high ...
[Discipulus]: you value too much your soul LanX
[Eily]: LanX: you mean people end up losing their health insurance?

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (14)
As of 2017-03-24 12:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (301 votes). Check out past polls.