CGI.pm - parameter name with dollar

Discussion in 'Perl Misc' started by jamesjesse68@yahoo.com, Feb 14, 2008.

  1. Guest

    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
    , Feb 14, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Javier Sandobal

    The Power Of One Dollar...

    Javier Sandobal, Dec 10, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    720
    Javier Sandobal
    Dec 10, 2004
  2. Norman Yuan
    Replies:
    0
    Views:
    850
    Norman Yuan
    Dec 8, 2005
  3. zzyzx

    Division of Dollar value

    zzyzx, Jul 22, 2004, in forum: Java
    Replies:
    12
    Views:
    1,393
    Michael Borgwardt
    Jul 23, 2004
  4. Iain Toft
    Replies:
    2
    Views:
    4,176
    Chris Lovett
    Jul 20, 2003
  5. Iain Toft
    Replies:
    4
    Views:
    1,691
    Mark Preston
    Jul 20, 2003
Loading...

Share This Page