Nedals
04-17-2003, 09:06 PM
I'm passing a javascript 'escaped()' string to a CGI script via the QUERY_STRING.
This works as long as I don't use 'strict' but when I do I get this error
....can't use global $1
$ENV{'QUERY_STRING'} = "n%26d+a%20l%24"; # test result to be "n&d+a l$"
my $data = $ENV{'QUERY_STRING'};
my $data =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack('C',hex($1))/eg;
print "$data\n";
Is there a simple soultion?
This works as long as I don't use 'strict' but when I do I get this error
....can't use global $1
$ENV{'QUERY_STRING'} = "n%26d+a%20l%24"; # test result to be "n&d+a l$"
my $data = $ENV{'QUERY_STRING'};
my $data =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack('C',hex($1))/eg;
print "$data\n";
Is there a simple soultion?