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:retty;
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
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:retty;
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