in reply to How does one return an Empty list as a return value
in thread Empty list as a return value
In other words this code:No, it's not. Watch this:shows that @x is bound to a list with one element.sub x { (); } @x = x(); use Data::Dumper; warn Dumper([\@x]);
This prints 0, as expected. You are handing to Data::Dumper a list of one item, that one item being a reference to your empty array. Stop indirecting so much!sub routine { return (); } @x = routine(); print 0+@x;
-- Randal L. Schwartz, Perl hacker
|
|---|