Because $temp contains a carriage-return, although I'm not sure what you are trying to do with that last one. (Also, your print statements do NOT contain a carriage return, and so they won't print quite the way you expect.)
chomp($temp = <STDIN>);
In reply to Re: Code question?
by jasonk
in thread Problem with simple program reading from STDIN
by yellowbeard
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |