As
dragonchild says, it's probably your term that is
causing the problem. If you're seeing ^H or ^? showing
up in your input when you test your program, it's not
Perl that's the problem, but your
stty setting
for erase that's not totally jiving with what you type.
Perl, like any other UNIX program, just takes what it's
given. That is, unless you're using something like
Term::ReadLine which flips the terminal into "raw"
mode. If you're seeing something messed up, the chances
are that it would happen with something as simple as
cat as well.