Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: chop is chopping off the last letter

by plaid (Chaplain)
on Jul 05, 2000 at 23:51 UTC ( #21209=note: print w/replies, xml ) Need Help??


in reply to chop is chopping off the last letter

I don't quite understand your question. You're chopping a variable, but you don't want it to chop off the last letter? If you don't want it to chop off the last letter, then why are you chopping at all? The way to fix it would just be to not chop.

If what you want is to get rid of any trailing newlines, but not do anything if there aren't any, take a look at chomp, which is a more intelligent version of chop.

  • Comment on Re: chop is chopping off the last letter

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2020-05-31 08:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (173 votes). Check out past polls.

    Notices?