in reply to Re: Subroutine evaluated as boolean
in thread Subroutine evaluated as boolean
Yes that's the effect if the scalar comma operator.
Just copy the list to a temporary @array to be returned.
Or return a literal construct like @{[L,I,S,T]}
Or best use a hash slice
return @$_{VALUE,NAME,ADDRESS} if ...
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Subroutine evaluated as boolean
by Anonymous Monk on Oct 13, 2014 at 01:07 UTC | |
by LanX (Saint) on Oct 13, 2014 at 01:14 UTC |