http://qs321.pair.com?node_id=21209


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