$oldpat = '-([0-9]+)-'; $newpat = '"_$1_"'; # note double quotes in single quotes $newname = $oldname; $newname =~ s/$oldpat/$newpat/ee; # note double ee #### -- Joost downtime n. The period during which a system is error-free and immune from user input.