http://qs321.pair.com?node_id=434298


in reply to Re: Determining subroutine return type
in thread Determining subroutine return type

Subs returning arrays behave differently to subs returning lists. If your sub returns an array, calling it in scalar context gets you the number of elements. In list context there's no difference.
perl -le "@a=(2,4,6); sub x{@a} print scalar(x());"
prints 3, not 6.