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]]"; }
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

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
    Correct, As Ratazong said above, I could not interpret this information correctly. Thnaks for your time.