in reply to Re^4: Global symbol requires explicit package name
in thread Global symbol requires explicit package name

Yes, but you can still use an ArrayRef, with the square brackets:

scalar_and_array_sub($foo, $bar, [@values[1..5]]); scalar_and_array_sub($foo, $bar, [$value1, $value2, $value3]); scalar_and_array_sub($foo, $bar, [split(/\s/, $string)]);
But I agree with you, if you don't pass too many arguments, you should use an Array instead of an ArrayRef.

Testing never proves the absence of faults, it only shows their presence.

Replies are listed 'Best First'.
Re^6: Global symbol requires explicit package name
by ColonelPanic (Friar) on Nov 29, 2012 at 06:28 UTC
    The first example doesn't provide equivalent functionality, however. When an array slice is passed normally, modifying @_ will modify the original array. But this makes an anonymous copy of the array slice, which is discarded after the function call.


    When's the last time you used duct tape on a duct? --Larry Wall