in reply to Re^2: perlsub question..
in thread perlsub question..

What do you load Data::Dumper for? Had you used it, you had found:

perl -e "sub x{ 1 for 1..5 };@y=x(); print Dumper(\@y) if defined @y" $VAR1 = [ '' ];

Looks pretty much "unspecified". Finding out what that sub actually returned is left as an exercise to the reader :-)

that depends on what it's return context is though, not necessarily a empty list..
Yes. Return values are evaluated in the caller's context at subroutine return, which may happen implicitly at the subroutine end.

No, subs always return a list. Sometimes it's empty, sometimes it has only one value. It's up to the caller how it treats that list, and it's up to the sub which elements it returns if it evaluates the context in which it is executed..

This discussion makes me marvel again upon how well written the perl documentation is...

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}