On Jul 27, Wagner-David said:

>       ps I tried to remove the \n on STDIN and got an error:
>
>Can't modify <HANDLE> in chomp at d:\currwrka\00COMM~1\03AAPL~1\aapl210.pl
>line 2, near "<STDIN>)"
> and the code looked like:
>
>chomp(<STDIN>);

Reading from a filehandle never automatically assigns to a variable,
unless you're using the special while (<FH>) syntax (or you've munged with
the filehandle with a tie()).

Furthermore, chomp() MODIFIES its arguments.  That's why you don't need to
say:

  $foo = chomp $foo;

In fact, if you did, you'd be upset. ;)

So Perl is telling you, rather explicitly, that you're trying to modify a
constant string returned by the <FH> operator.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734
**      Manning Publications, Co, is publishing my Perl Regex book      **


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to