I have a function (let it be called foo($array_reference, ...) ) that expects an array reference among other parameters. I want foo offset the array reference from the list of parameters passed directly to the array, without having to offset it as an array reference, and then separately convert it to an array.
What I want should be something like this:
my @bar = @{shift};
What I don't want, but currently I'm stuck:
my $bar = shift; my @bar = @{$bar}
The latter approach takes lines, loses memory, and makes me hate the writer of this type of Perl code with fiery passion. Help me please?
source share