in reply to manipulating <SDTIN>

Yes, use chomp($i);.

In practice:

while (defined(my $i = <STDIN>)) { chomp($i); print("[$i]\n"); }
while (<STDIN>) { chomp; print("[$_]\n"); }