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


in reply to Re^2: Combining two actions in RegExp
in thread Combining two actions in RegExp

$phone =~ tr/)(/-/d; says to delete the parentheses and also replace the closing paren with '-';

To also delete any spaces, you could use $phone =~ tr/)(\x20/-/d; where '\x20' is the hex value of a 'space'. You could also use $phone =~ tr/)( /-/d; without the hex value of a space and just use a literal space instead. (The hex version just makes the 'space' more explicit).