Re: $r-args troubles...

2000-04-12 Thread Jason Murphy


You would have guessed right. However, the problem was two fold in my case.

First, I was not calling Apache::Request correctly. The proper method to
call Apache was told to me by Doug Kyle (Giving credit where due!). Below is
how it is done.

--- Begin Example

my $r = Apache-request;
my $apr = Apache::Request-new($r);

my %params = $apr-args;

print $params{"Player"};

 End Example

The 'print $params{"Player"}' would be used to get and print something like
the parameters from the URL of a GET like
"www.example.com/find_player.pl?Player=Mullen" (Not a real site, dont
click!).

Second part of my problem was that I had an error in my Apache::Registry
setup in Apache.conf or perl.conf (Can't remember where I put it). The
script I was running was not being picked up by Apache::Registry and thus
not working.

 Thanks for everyone's help.

PS. The only reason I say this on the mailing list is to get it in to the
mailing list archives because I could not my solution there when I looked.


From: "Doug MacEachern" [EMAIL PROTECTED]
To: "Jason Murphy" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, April 11, 2000 8:52 PM
Subject: Re: $r-args troubles...

 On Fri, 7 Apr 2000, Jason Murphy wrote:
  Can't locate object method "new" via package "Apache::Request" at
  ./find_player.pl line 10.

 that would normally indicate your script is running under mod_cgi, not
 mod_perl.

  my $r = new Apache::Request;  ---Where the error appears

 in any case, you need to change that to:

 my $r = Apache::Request-new(shift);
 or
 my $r = Apache::Request-new(Apache-request);



--
 Jason Murphy
 System Administrator
 Lawinfo.com
 1-800-397-3743 ex: 133






RE: $r-args troubles...

2000-04-07 Thread Geoffrey Young

you are calling Apache::Request-new incorrectly - see the docs :)

 -Original Message-
 From: Jason Murphy [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 07, 2000 2:07 PM
 To: [EMAIL PROTECTED]
 Subject: $r-args troubles...
 
 
 Dear Mod_Perl'lers
 
 I hate to bug the list with this simple problem, but I am at 
 my wits end. I
 have The Good Book (Aka: Apache Modules with Perl and C. Aka: 
 The Eagle
 Book) but have some questions that are just killing me.
 
 I would like to do something like the program on page 104 - 
 110 and also
 page 130 - 135 of The Eagle book. For those of you not 
 blessed with this
 book, I am trying to recover the parameter from a GET 
 request. Below is my
 code I correctly using, but my problem is the Apache::Request and
 Apache::Constant are not being found or used or whatever is 
 the error (Error
 posted below).
 
 Some notes, I have tried adding "use Apache::Constants 
 qw(:common)" but it
 also returns the same error. I have also replaced the last 
 line with "my
 ($FirstInfo, $SecondInfo) = split /=/, $r-args;" with no 
 success either. I
 have those modules installed, and I forced reinstalled them 
 to make sure
 along with Bundle::Apache.
 
 If anyone could point me to a really good example of the 
 r-args and GET
 requests I would really appreciate it.
 
 ---My Error---
 
 Can't locate object method "new" via package "Apache::Request" at
 ../find_player.pl line 10.
 
 
 
 ---MY CODE---
 
 use strict;
 
 use Apache::Request ();
 use CGI qw(:standard);
 use DBI;
 
 my $r = new Apache::Request;  ---Where the error appears
 my $dbh ||= DBI-connect('dbi:mysql:Action', 'login', 
 'password') || die
 "Could not open Database: ";
 
 my ($person_id, $name, $totalkills, $totalkilled);
 my %arguments = $r-args;
 
 
 
 
 
 --
  Jason Murphy
  System Administrator
  Lawinfo.com
  1-800-397-3743 ex: 133
 



Re: $r-args troubles...

2000-04-07 Thread Doug Kyle

It goes like this:

my $r = Apache-request;
my $apr = Apache::Request-new($r);

--
Doug Kyle - Information Systems
Grand Rapids Public Library
"We're superheros man, we don't have time to be charming . . . we're public
servants, not glamour boys" - The Tick.


Jason Murphy wrote:

 Dear Mod_Perl'lers

 I hate to bug the list with this simple problem, but I am at my wits end. I
 have The Good Book (Aka: Apache Modules with Perl and C. Aka: The Eagle
 Book) but have some questions that are just killing me.

 I would like to do something like the program on page 104 - 110 and also
 page 130 - 135 of The Eagle book. For those of you not blessed with this
 book, I am trying to recover the parameter from a GET request. Below is my
 code I correctly using, but my problem is the Apache::Request and
 Apache::Constant are not being found or used or whatever is the error (Error
 posted below).

 Some notes, I have tried adding "use Apache::Constants qw(:common)" but it
 also returns the same error. I have also replaced the last line with "my
 ($FirstInfo, $SecondInfo) = split /=/, $r-args;" with no success either. I
 have those modules installed, and I forced reinstalled them to make sure
 along with Bundle::Apache.

 If anyone could point me to a really good example of the r-args and GET
 requests I would really appreciate it.

 ---My Error---

 Can't locate object method "new" via package "Apache::Request" at
 ./find_player.pl line 10.

 ---MY CODE---

 use strict;

 use Apache::Request ();
 use CGI qw(:standard);
 use DBI;

 my $r = new Apache::Request;  ---Where the error appears
 my $dbh ||= DBI-connect('dbi:mysql:Action', 'login', 'password') || die
 "Could not open Database: ";

 my ($person_id, $name, $totalkills, $totalkilled);
 my %arguments = $r-args;

 --
  Jason Murphy
  System Administrator
  Lawinfo.com
  1-800-397-3743 ex: 133