Russbucket wrote:
> SUSE Linux 10.0 perl 5.8.7-5.3
>
> I have a Perl (cgi) program that runs under windows. I am moving it to Linux.
> When I execute it from the command line (/usr/bin/perl memberretreive.cgi
> -cw) I get an error that says there is an error after the C in line 11.
>
> this is the line:
> $value =~ s/%([a-fA-F0-9] [a-fA-F0-9]) /pack(''C'', hex($1))/eg;
>
> Can anyone point me in the right direction.
> Thanks for any assistance!!
Hi,
It appears that you are using two single quotes in place of a double
quote on each side of the 'C', so the argument grouping to pack() is
off. Try this:
$value =~ s/%([a-fA-F0-9] [a-fA-F0-9]) /pack("C", hex($1))/eg;
This ensures that "C" is interpreted as a literal string, rather than as
an empty string followed by a C followed by an empty string.
Cheers,
kjw
_______________________________________________
Perl-Unix-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs