|Just another Perl shrine|
Re^3: wantarray alternativeby LanX (Chancellor)
|on Jul 10, 2013 at 19:53 UTC||Need Help??|
> If there's only one value in the return list, how can I return that value in scalar context, not the count of 1?
just return the list! In scalar context the last element is taken, so if you are only returning "one value in the return list" thats the same.
It's the scalar of an array(!) which counts.
ok not that easy, avoid scalar context and explicitly put the scalar into a list at LHS.
Though we asked several times you haven't clarified which result you expect in in case of scalar context and longer list!
( addicted to the Perl Programming Language)