When you are reading from the file, the value of
$test{bell} will be a four character
string, consisting of a backslash, two zero's and
a seven. "\007" is only going to be
interpreted a bell character if it appears like this
in the program text.
You might want to use an eval, or chr substr $2, 1.