in reply to should this backspace removal code be done better?

Yes, you can use the regular expression more efficiently.
{ local $_ = "this is an\b correct usage"; s/(.[\b])//; print "$_\n"; }
:-)

Replies are listed 'Best First'.
Re: Re: should this backspace removal code be done better?
by bart (Canon) on Oct 05, 2003 at 07:40 UTC
    Have you even tried it?

    The OP wants to match a backspace, not a backslash followed by a "b"...

    /\b/ doesn't match a backspace, though, but a word boundary. You have to use it in a class to make it match.

    s/.[\b]//g;