$_ = "this is an\b correct usage"; my $buff = ''; while (m/(.)/g) { if ($1 eq "\b") { chop($buff) } else { $buff .= $1 } } print $buff;
In reply to should this backspace removal code be done better? by smackdab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |