in reply to Reference to return value of a subroutine
Well, you can, but you just have to use an alternate syntax:
my $var = [foo()];
In this case, you should know in advance that foo() returns a list that you want to take as an array reference. If a scalar is returned, it will automatically be populated as the first element in the array reference, regardless of its type.
|
|---|