sub makeSql { my @xpid = @{shift()}; ^^ ^ # dereference the array reference
Perl 5 doesn't know automatically that it received a scalar reference and cannot automatically create an array out of that. You need to tell it yourself.
Please note the parenthesis with shift. You also need these to disambiguate with a global array with the name "shift".
Hope this helps.
Liz
In reply to Re: Help w passing array by ref
by liz
in thread Help w passing array by ref
by alienhuman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |