in reply to Unexpected chomp behavior

Hmmm, as a non-newbie of other programming languages, you surely know the difference between the return value of a function, and its side-effects?

I'm a bit baffled by the question - it's not that you assume chomp leaves its arguments untouched and returns the the chopped lines - then you would have written the first fragment as

my @lines = chomp(<STDIN>);
which would result in an error.