Re: a mystery.. need help

[prev] [thread] [next] [Date index for 2005/05/30]

From: Tom Schindl
Subject: Re: a mystery.. need help
Date: 07:55 on 30 May 2005
-----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-----

(message missing)

Apache2::Reload problems
Mark 06:42 on 25 May 2005

Re: Apache2::Reload problems
Stephane GUIBOUD-RIBAUD 06:48 on 25 May 2005

Re: Apache2::Reload problems
Mark 15:53 on 25 May 2005

Re: Apache2::Reload problems
Stas Bekman 17:37 on 25 May 2005

Should I use Package or Modual or what?
Luinrandir Insight 17:19 on 25 May 2005

Re: Should I use Package or Modual or what?
Perrin Harkins 17:16 on 25 May 2005

Re: Should I use Package or Modual or what?
Perrin Harkins 17:57 on 25 May 2005

a mystery.. need help
Luinrandir Insight 08:36 on 29 May 2005

[OT] Re: a mystery.. need help
Frank Maas 10:37 on 29 May 2005

Re: Apache2::Reload problems
Philippe M. Chiasson 09:24 on 25 May 2005

Re: Apache2::Reload problems
Mark 15:30 on 25 May 2005

Re: a mystery.. need help
David Dick 05:37 on 29 May 2005

Re: a mystery.. need help
Luinrandir Insight 02:10 on 30 May 2005

Re: a mystery.. need help
Tom Schindl 07:55 on 30 May 2005

Re: a mystery.. need help
jonathan vanasco 16:23 on 30 May 2005

Re: a mystery.. need help
Luinrandir Insight 20:15 on 30 May 2005

[MP2] How to turn off caching?
Foo Ji-Haw 04:23 on 31 May 2005

Re: [MP2] How to turn off caching?
Rodger Castle 05:11 on 31 May 2005

Re: [MP2] How to turn off caching?
Foo Ji-Haw 07:45 on 31 May 2005

Re: [MP2] How to turn off caching?
Torsten Foertsch 09:31 on 31 May 2005

Re: [MP2] How to turn off caching?
Issac Goldstand 08:50 on 31 May 2005

Generated at 20:12 on 05 Jun 2005 by mariachi v0.52