in reply to Re: help with REGEXP to remove carriage return and caret from end
in thread help with REGEXP to remove carriage return and caret from end
Not such a smart thing generally. Chop will remove the last character regardless of what it was. If it was a multiple character sequence then you have stuffed things for chomp - it won't remove the mutliated line end sequence. If it was a single character then the chomp is not required. In neither case is chomp going to do anything useful following chop.
chomp first to remove the line end sequence (which may comprise many characters if $/ has been altered) and then chop if you really want to always remove the last character (doesn't happen often actually).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: help with REGEXP to remove carriage return and caret from end
by CountZero (Bishop) on Jul 25, 2006 at 21:44 UTC | |
by GrandFather (Saint) on Jul 25, 2006 at 22:04 UTC | |
by CountZero (Bishop) on Jul 26, 2006 at 06:06 UTC |