|
|
| go ahead... be a heretic | |
| PerlMonks |
Re: Predefining sub Parametersby dynamo (Chaplain) |
| on Jun 22, 2005 at 17:25 UTC ( #469103=note: print w/ replies, xml ) | Need Help?? |
|
Well, you're going to have to change that array in the middle. You can either make it a reference, or move it to the end. Also, you have to read in the parameters yourself, it's not quite as automatic as C or Java in that sense. So by the first option, it should be: That code would be called like: functionname("string",['array_item1', $arrayItem2, '...'], "other_string_param"); Or, you could put it at the end: where it'll slurp up all remaining args. And that code would be called like: functionname("string", "other_string_param", 'array_item1', $arrayItem2, '...'); Hope that helps.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||