in reply to
why the 2nd program doesn't work?
Try:
... print chomp($x=<STDIN>); ...
[download]
it returns 1 !
From "Programming Perl":
Unlike chop, chomp returns the number of characters deleted.
Comment on
Re: why the 2nd program doesn't work?
Download
Code
In Section
Seekers of Perl Wisdom