-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

1. To parse Parameters you should use:
~   a) CGI.pm
~      -----------------------8<-----------------------
~      my $q = new CGI();
~      my %form;
~      foreach( $q->param() ) {
~          $form{$_} = $q->param($_);
~      }
~      -----------------------8<-----------------------
~   b) Apache::Request or Apache2::Request => faster but only available
~      in mod-perl
2. The parameters in your second URL does not make any sense I think
they should be from a multi-selection box at least the braces '(' are
not supported in uris are escaped normally. But CGI can handle those
params fairly easily.
~      ----------------------8<----------------------
~      my @data = $q->param("Data");
~      ----------------------8<----------------------

3. I'd suggest you get:
~   a) a Perl Beginners book
~   b) a mod-perl book

Tom

Luinrandir Insight schrieb:
| OK.. first .. if I have the wrong list.. if this list is just about
moduals
| and apache please forgive.
| I thought this list was about moduals, which I am just learning about.
This
| is a subroutine that is going to go into a package/modual once I get it
| working.
| ALSO... perl is my HOBBY.... my background is GWbasic and pascal from 20
| years ago.
| I do not have a degree... so be nice to me.
|
| This piece of code is suppossed to take the Data from the Query string...
| $Data = $ENV{QUERY_STRING};
| and assign the value to the the vars.
| I am trying to move away from the commented out stuff below to something
| more strealine.
| I want to change my QUERY_STRING from:
| ca.cgi?PlayerName=Luinrandir&TownName=Avalon&Location=Castle&Action=Move
| to
| ca.cgi?Data(2)=Luinrandir&Data(3)=Avalon&Data(5)=Castle
|
| and this is the sub (to be modual) that is going to handle the data.
|
| sub ParseInput  # from previous page
| {
|     @pairs = split ( /&/, $Data );
|     foreach $pair(@pairs)
|     {
|         ( $name, $value ) = split ( /=/, $pair );
|   #changes plus sign to space
|         $name =~ tr/+/ /;
|         $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
|         #$name =~ tr/\0//d;
|         $value =~ tr/+/ /;
|         $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
|         #$value =~ tr/\0//d;
|          $form{$name} = $value;
|     }
|
| ### new code???#####
|  foreach $v0(0 .. 150)
|  {
|         if ($Data[$v0] eq "")
|         {
|             $Data[$v0] = $form{Data($v0)}; <<<<<<< this line does not work
|         }
|  }
|
| #### old code #####
| #        $Data[2]    = $form{PlayerName};
| #        $Data[3]    = $form{TownName};
| #        $Data[5]    = $form{Location};
|
| }
|
|
|

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCmsbakVPeOFLgZFIRAkJHAJwLv147CABrL5Kuuv2BEgkua0dGhwCguW6P
oE1TuXL/TQvw3S+vzdb9COQ=
=2IPy
-----END PGP SIGNATURE-----

Reply via email to