Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Keep It Simple, Stupid
 
PerlMonks  

Re: Chomp is removing the whole word instead of the newline

by tobyink (Prior)
on Jul 25, 2012 at 09:35 UTC ( #983591=note: print w/ replies, xml ) Need Help??


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'


Comment on Re: Chomp is removing the whole word instead of the newline
Select or Download Code
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://983591]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2013-05-21 02:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (427 votes), past polls