in reply to Empty List miracle(1)
If I understand things correctly:
qw,, in scalar context returns undef, however in list context (assigning to an array), it will set the array to an empty array.
Similarly for ().
The real issue here is the differences between returning data in list and scalar context.
So, if you substitute your print statements for these, you will get '0' printed 3 times.
my @a; print(scalar(@a=empty_list1()),"\n"); print(scalar(@a=empty_list2()),"\n"); print(scalar(@a=empty_list3()),"\n");
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Empty List miracle(1)
by ikegami (Patriarch) on Apr 30, 2010 at 14:50 UTC |
In Section
Seekers of Perl Wisdom