in reply to Re: Re: Chomp(<handle>)
in thread Chomp(<handle>)
$ perl -e 'chomp(" foo ");' Can't modify constant item in chomp at - line 1, near "" foo ")"
Different error messages. In the first case, it complains about modifying a non-lvalue (a constant item). In the second case, it complains about modifying the results of reading from a file handle.$ perl -e 'chomp(<STDIN>);' Can't modify <HANDLE> in chomp at - line 1, near "<STDIN>)"
I'll grant you that chomp SCALAR can't chomp a non-lvalue, if you'll grant that the ambiguous context of the syntax chomp <FOO> is another valid reason that the compiler gives a separate distinct message.
--
[ e d @ h a l l e y . c c ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Chomp(<handle>)
by dws (Chancellor) on Jul 14, 2003 at 19:23 UTC | |
|
Re: Re^3: Chomp(<handle>)
by edan (Curate) on Jul 15, 2003 at 11:31 UTC |