Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- CGI.pm - parameter name with dollar
February 14, 2008, 3:23 pm
rate this thread
I am trying to grab some params with CGI.pm. Normally not hard but the
names are like $selected.fieldname eg
These params are passed in by an application I canot change <sigh>.
And there is some existing code that does not use CGI.pm and does
rather too much print raw html.
here is the code that works:
$buffer = $ENV;
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
($name, $value) = split(/=/, $pair);
# Un-Webify plus signs and %-encoding
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM = $value;
and here is the code that does not:
use CGI::Carp qw(fatalsToBrowser);
use CGI ':standard';
my $ServerSerial = param( '$selected.Server' );
and here is the URL that calls the cgi
- Lawrence Statton
February 14, 2008, 3:41 pm
Re: CGI.pm - parameter name with dollar
When you see the difference between "$selected.Server" and
'$selected.Server' and you will have solved your problem.
Lawrence Statton - firstname.lastname@example.org s/aba/c/g
Computer software consists of only two components: ones and
zeros, in roughly equal proportions. All that is required is to
place them into the correct order.