in reply to Chomp is removing the whole word instead of the newline
chomp operates in-place. The return value isn't especially useful.
use 5.010; say "enter some text lines"; while (my $line = <>) { say "\$line is [[$line]]"; say "doing the chomp thing!"; my $return = chomp $line; say "\$line is now [[$line]]"; say "\$return is [[$return]]"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Chomp is removing the whole word instead of the newline
by slayedbylucifer (Scribe) on Jul 25, 2012 at 09:52 UTC |