in reply to Execute regexp on directory tree

If you want to replace for the content of $1 you must use /ee modifier to the regex.
$line =~ s/$regexp/$substitute/ee;
One advice, its better to use a negated character class:
qr/throw "([^"]+)"/;
Update I forgot to say that then you have to change the substitution pattern to something to be evaluated:
my $substitute = q{qq<throw ("$1")>};

$anarion=\$anarion;

s==q^QBY_^=,$_^=$[x7,print