Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > CGI.pm - parameter name with dollar

Reply
Thread Tools

CGI.pm - parameter name with dollar

 
 
jamesjesse68@yahoo.com
Guest
Posts: n/a
 
      02-14-2008
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/MyServe...ed.Server=FRED

Any suggestions?

TIA
J
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET: dollar sign ($) changed to undisplayable characters Norman Yuan ASP .Net 0 12-08-2005 11:17 PM
The Power Of One Dollar... Javier Sandobal ASP .Net 0 12-10-2004 05:50 PM
CISCO VPN3000 - Million Dollar Question Matthew Cisco 1 10-01-2004 04:56 AM
Division of Dollar value zzyzx Java 12 07-23-2004 08:35 AM
Euro Dollar Frustration - XSLT, ASP Iain Toft XML 2 07-20-2003 05:22 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57