in reply to Re^2: Type of arg 1 to shift must be array (not sort)
in thread Type of arg 1 to shift must be array (not sort)
just writemy $result = shift @{[some list function]};
A whole lot easier on the CPU and the eyes. That's why I invented the literal slice (one of the few things I can lay direct claim to in Perl).my $result = (some list function)[0];
Of course, if you're going to store it into a scalar like this, you can simplify it further:
my ($result) = some list function;
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|