Re: a mystery.. need help

2005-05-30 Thread Tom Schindl

-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-


Previous Pages/Requests appearing

2005-05-30 Thread cfaust-dougot
Folks,
 
I am having problems with previous pages/requests 
showing up on refreshes and/or the clicking on links not going to the proper 
page etc. etc.
 
Its a new server and I didn't think it was the code 
so I commented out all mod_perl scripts and added the simple script 
below.
 
I also got the same problem with the script, even 
though I had "?aaa=true", the page wouldn't change to what was defined by the 
"print_aaa" sub, switching to "?bbb=true" would result in no change 
either.
 
What is strange is all I would need to do is wait 4 
or 5 seconds and then go back and the very first request would always do the 
proper thing, of course "perl-status" showed a new process (perl-status never 
showed more then 1 process during the testing).
 
Any idea?
 
Thanks
-Chris
 
 
# Test Script ##
package MP2ShareTest;
 
use strict;use CGI;use vars qw($r $CGI);
### 
Main# Our Mod_Perl Content Handlersub handler { $r = 
shift;
 $CGI = new CGI(); my %form_data = (); %form_data = 
$CGI->Vars;
 if ($form_data{'bbb'} eq 'true') 
{  &print_bbb(); } elsif ($form_data{'aaa'} eq 
'true') {  &print_aaa(); } else 
{  print "No Form Data"; }  return 
Apache2::Const::OK; } # End of 
Subsub 
print_aaa {
 print 'Click for 
BBB';}sub 
print_bbb {
 print 'Click for 
AAA';}##1;

RE: Previous Pages/Requests appearing

2005-05-30 Thread cfaust-dougot



Sorry, should have said I was 
running MP2 under RH
 
Apache/2.0.54 (Unix) mod_perl/2.0.0 Perl/v5.8.0 configured
 


From: cfaust-dougot 
[mailto:[EMAIL PROTECTED]Sent: Mon 5/30/2005 10:30 
AMTo: modperl@perl.apache.orgSubject: Previous 
Pages/Requests appearing

Folks,
 
I am having problems with previous pages/requests 
showing up on refreshes and/or the clicking on links not going to the proper 
page etc. etc.
 
Its a new server and I didn't think it was the code 
so I commented out all mod_perl scripts and added the simple script 
below.
 
I also got the same problem with the script, even 
though I had "?aaa=true", the page wouldn't change to what was defined by the 
"print_aaa" sub, switching to "?bbb=true" would result in no change 
either.
 
What is strange is all I would need to do is wait 4 
or 5 seconds and then go back and the very first request would always do the 
proper thing, of course "perl-status" showed a new process (perl-status never 
showed more then 1 process during the testing).
 
Any idea?
 
Thanks
-Chris
 
 
# Test Script ##
package MP2ShareTest;
 
use strict;use CGI;use vars qw($r $CGI);
### 
Main# Our Mod_Perl Content Handlersub handler { $r = 
shift;
 $CGI = new CGI(); my %form_data = (); %form_data = 
$CGI->Vars;
 if ($form_data{'bbb'} eq 'true') 
{  &print_bbb(); } elsif ($form_data{'aaa'} eq 
'true') {  &print_aaa(); } else 
{  print "No Form Data"; }  return 
Apache2::Const::OK; } # End of 
Subsub 
print_aaa {
 print 'Click for 
BBB';}sub 
print_bbb {
 print 'Click for 
AAA';}##1;

Re: a mystery.. need help

2005-05-30 Thread jonathan vanasco
This list is just about mod_perl -- the apache module that integrates a 
perl interpreter into apache


To learn about apache modules, look on a website like perlmonks.com


On May 29, 2005, at 10:10 PM, Luinrandir Insight wrote:

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.




Re: a mystery.. need help

2005-05-30 Thread Luinrandir Insight
ok.. thanks
and since thats not me.. i'm gone.
Lou

- Original Message - 
From: "jonathan vanasco" <[EMAIL PROTECTED]>
To: "Luinrandir Insight" <[EMAIL PROTECTED]>
Cc: 
Sent: Monday, May 30, 2005 9:23 AM
Subject: Re: a mystery.. need help


> This list is just about mod_perl -- the apache module that integrates a 
> perl interpreter into apache
> 
> To learn about apache modules, look on a website like perlmonks.com
> 
> 
> On May 29, 2005, at 10:10 PM, Luinrandir Insight wrote:
> 
> > 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.
> 
> 



[MP2] How to turn off caching?

2005-05-30 Thread Foo Ji-Haw

Hi guys,

If I am not mistaken, modperl tends to cache all output until the script 
is completed, then it sends out the page. If I want to (for example) 
print a period (.) back to the browser every second, what do I need to 
do? I tried $| but it does not work.


Thanks in advance for your advice.