in reply to Other form of greediness in Perl
Parameters passing and return values are greedy.
It has nothing to do with parameter passing or values being returned. It's assigning a list to an array that's "greedy". It doesn't matter if the RHS of the assignment is @_ or a function call.
my (@array, $scalar) = (1, 2, 3); print(scalar(@array), "\n"); # 3 print(defined($scalar)?1:0), "\n"); # 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Other form of greediness in Perl
by naikonta (Curate) on Oct 01, 2007 at 17:38 UTC |