Just a note on the use of backshashes in Perl strings. Consider the following, which uses 3 ways to represent the string with which $text1 is initialised:
#! perl
use strict;
use warnings;
my %patterns =
(
original_text => "\<\?php\ \@error_reporting\(0\)\;\ if\ \(\!isset
+\(\$eva1fYlbakBcVSir\)\)\ \{\$eva1fYlbakBcVSir\ \=\ \"7kyJ",
double_quoted => "<?php \@error_reporting(0); if (!isset(\$eva1fYl
+bakBcVSir)) {\$eva1fYlbakBcVSir = \"7kyJ",
single_quoted => '<?php @error_reporting(0); if (!isset($eva1fYlba
+kBcVSir)) {$eva1fYlbakBcVSir = "7kyJ',
);
for (qw[original_text double_quoted single_quoted])
{
my $text = $patterns{$_};
my $re = qr[^\Q$text\E];
print "\n", $_, ': ', "\n", $text, " -->\n", $re, "\n";
}
The output shows that the strings are identical, as are the corresponding regular expressions. See Quote and Quote like Operators, which says:
Apart from the behavior described above, Perl does not expand multiple levels of interpolation. In particular, contrary to the expectations of shell programmers, back-quotes do NOT interpolate within double quotes, nor do single quotes impede evaluation of variables when used within double quotes.
All of this may or may not help with the stated problem. But it will certainly help in writing clearer and more readable code.