This had bugged me too. But the solution I had arrived at is slightly
different. What do you think?
($retval, $scalar) = chomp $scalar;
or
($retval, @list) = chomp @list;
In list mode chomp returns a list whose first element is the return value,
the remainder being the modified value(s).
In current scalar mode, chomp acts upon the value(s) *in place* and returns
a value.
Pro's:
Breaks nothing
Fairly intuitive. To make it more so, perhaps perlrun should place
an emphasis upon list mode usage...?
Ref [1]: http://tmtowtdi.perl.org/rfc/58.pod
--
* __ * .
\ | / . . . . . ((_
_____ . . .
-- / \ -- . . . + . . _/\
oooooooooo. | * . . . * / ;M\_ .
.oooooooooooo.oo. . . . . /\ . / :IMM\
..oooooooooooo..oo. Jerrad Pierce /\ / \ / ;IIWMM
..oooooooooo....... 209 North Street + / \ / \ . / ;IIIIWM
...ooooooooo....... Randolph, MA 02368 / \ \ ___/ :;IIIIIWM
....ooo....o....... / \ \ / :: ;;IIIMI
.....ooo......... http://www.pthbb.org / \ \ : :::;IIIM
..ooooooo.... __________________________ || || ::.....::::::
MOTD on Setting Orange, the 11st of Bureaucracy, in the YOLD 3166:
This statement is false.