Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

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

by tobyink (Canon)
on Jul 25, 2012 at 09:35 UTC ( [id://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'

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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-03-29 04:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found