I\'m reading strings from a file. Those strings contain escape sequences which I would like to have evaluated before processing them further. So I do:
$t = e
oh gah don't use eval for this, thats dangerous if someone provides it with input like "system('sync;reboot');"..
But, you could do something like this:
#!/usr/bin/perl $string = 'foo\"ba\\\'r'; printf("%s\n", $string); $string =~ s/\\([\"\'])/$1/g; printf("%s\n", $string);