CGI.pm - parameter name with dollar

J

jamesjesse68

Hello,
I am trying to grab some params with CGI.pm. Normally not hard but the
names are like $selected.fieldname eg
$selected.ServerNumber.

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{'QUERY_STRING'};
@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{$name} = $value;
}
...
$Server= $FORM{"\$selected.Server"})

and here is the code that does not:
use strict;
use warnings;
use CGI::Carp qw(fatalsToBrowser);
use CGI ':standard';
use CGI::pretty;
my $ServerSerial = param( '\$selected.Server' );

and here is the URL that calls the cgi

http://192.168.12.10/cgi-bin/MyServer.cgi?$selected.Server=FRED

Any suggestions?

TIA
J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top