Re: Newbie question about mod_perl capabilities

2003-07-08 Thread Matt Sergeant
On Monday, Jul 7, 2003, at 20:50 Europe/London, Ged Haywood wrote:

On 7 Jul 2003, Walter H. van Holst wrote:

 I am new to mod_perl and am trying to figure out whether it suits my
needs or not. Can I use it to intercept any http CONNECT requests 
Apache
receives and answer those?
The concept of a connection is at the transport level, way below HTTP.
The HTTP protocol simply assumes a reliable transport (you don't even
need an Internet:) and deals with exchanges of messages.  See RFC1945.
Sorry Ged, Walter is talking about CONNECT which is a proxy request. It 
goes in place of GET or POST in the request line:

CONNECT mail.openrelay.com:25 HTTP/1.1

I *think* mod_perl will be able to intercept this, but I've never tried 
it. You might need to do it very early on in the request, and make sure 
it gets passed through to mod_proxy later on or things just won't work.

Matt.



Re: Newbie question about mod_perl capabilities

2003-07-08 Thread Walter H. van Holst
On Tue, 2003-07-08 at 10:14, Matt Sergeant wrote:

 Sorry Ged, Walter is talking about CONNECT which is a proxy request. It 
 goes in place of GET or POST in the request line:
 
 CONNECT mail.openrelay.com:25 HTTP/1.1
 
 I *think* mod_perl will be able to intercept this, but I've never tried 
 it. You might need to do it very early on in the request, and make sure 
 it gets passed through to mod_proxy later on or things just won't work.

Well, thanks to a someone on IRC I have found a code snippet that might
do exactly that. So it appears that mod_perl can do this. And yes, it is
intended for exactly the kind of CONNECT requests you describe.

Regards,

 Walter
-- 
Like almost everyone, I receive a lot of spam every day, much of it
offering to help me get out of debt or get rich quick. It's ridiculous.
(Bill Gates)



Re: Newbie question about mod_perl capabilities

2003-07-08 Thread Ged Haywood
Hi there,

On 8 Jul 2003, Walter H. van Holst wrote:

 On Tue, 2003-07-08 at 10:14, Matt Sergeant wrote:
 
  Sorry Ged, Walter is talking about CONNECT which is a proxy request.

Argh.  :)

 Well, thanks to a someone on IRC I have found a code snippet that might
 do exactly that. So it appears that mod_perl can do this. And yes, it is
 intended for exactly the kind of CONNECT requests you describe.

:)

73,
Ged.



Re: Newbie question about mod_perl capabilities

2003-07-07 Thread Ged Haywood
Hi there,

On 7 Jul 2003, Walter H. van Holst wrote:

  I am new to mod_perl and am trying to figure out whether it suits my
 needs or not. Can I use it to intercept any http CONNECT requests Apache
 receives and answer those?

The concept of a connection is at the transport level, way below HTTP.
The HTTP protocol simply assumes a reliable transport (you don't even
need an Internet:) and deals with exchanges of messages.  See RFC1945.

Read the Eagle Book (*), for more information about where mod_perl
fits into the scheme of things.  Chapter 3 has a good explanation of
the Apache request cycle.

73,
Ged.

(*) Writing Apache Modules with Perl and C, ISBN 1-56592-567-X



RE: Newbie question

2001-07-12 Thread Purcell, Scott

Yes,
Go to Ron Savages site. He has a binary build of Apache + mod_perl and also
the latest perl.
http://www.savage.net.au
go to the navigation and press on Perl, and look under Perl Modules and look
three bullet items down ... It is there. Follow along.

I have used it twice and it gets you operational in about an hour.

Yell if you have any questions, as I have done this twice on NT.

Scott

-Original Message-
From: Randy Kobes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 12, 2001 10:20 AM
To: Jason
Cc: [EMAIL PROTECTED]
Subject: Re: Newbie question


On Thu, 12 Jul 2001, Jason wrote:

 Sorry if this is in an FAQ somehere (googled for it, but no luck).

 Does anyone know of a *good* guide to compiling/configuring/installing
 Apache + mod_perl on a Windows NT system?

INSTALL.win32 in the mod_perl sources describes how to build
and install mod_perl - this is geared towards using VC++.

As for configuring, if you have Apache set up already, the
configuration and use is very similar to Unix - see http://take23.org/
and http://perl.apache.org/, especially the guide, for lots
more info on that. There's a sample Win32 httpd.conf at
http://theoryx5.uwinnipeg.ca/ppmpackages/httpd.conf-perl
that contains a number of common directives used for mod_perl
related things.

 The impression I get from scouting newsgrops is that most people resort to
 using a prebuild binary - so I figure it must be tricky?

No, not really - the build process differs from Unix, but after that,
and taking into account the differences in general with Perl/Apache
on Win32, it's relatively straightforward to use.

best regards,
randy kobes



Re: Newbie question to mod_perl and Apache::DBI

2001-02-08 Thread Ajit Deshpande

On Thu, Feb 08, 2001 at 11:57:50PM +0100, Caroline Kliegl wrote:
[..] 
 With my other script, updating data, I get the following error :
 
 Rebuild with -DPERL_STACKED_HANDLERS to $r-push_handlers at
 /usr/local/lib/perl5/site_perl/5.6.0/Apache/DBI.pm line 93.
 [..]

You need to compile mod_perl with PERL_STACKED_HANDLERS = 1.

See following for details:
http://perl.apache.org/guide/databases.html#Apache_DBI_does_not_work

Ajit



Re: Newbie question to mod_perl and Apache::DBI

2001-02-08 Thread G.W. Haywood

Hi there,

On Thu, 8 Feb 2001, Caroline Kliegl wrote:

 I am new to mod_perl and currently trying to make use of Apache::DBI.
 
 I get the following error :
 
 Rebuild with -DPERL_STACKED_HANDLERS to $r-push_handlers at
 /usr/local/lib/perl5/site_perl/5.6.0/Apache/DBI.pm line 93.

I think it wants you to rebuild with -DPERL_STACKED_HANDLERS.

http:perl.apache.org/guide - see the section on configuration.

73,
Ged.




RE: Newbie question to mod_perl and Apache::DBI

2001-02-08 Thread Geoffrey Young

Apache::DBI will call push_handlers on to issue a rollback if AutoCommit=0
in your connect string...

but the problem may not be with you... looks like a bug (somewhere):

if(!$Rollback{$Idx} and $needCleanup and Apache-can('push_handlers'){ 
  ...
}
 
looks like calling Apache-can('push_handlers') is returning true even
though you didn't activate PERL_STACKED_HANDLERS.  I wonder if somehow can()
isn't correctly capturing the build-time arguments (something to look
into...)

at any rate, the quickest way to fix this is to rebuild mod_perl with
EVERYTHING=1 or PERL_STACKED_HANDLERS=1 (or don't set AutoCommit=0 in your
connect string if you can't rebuild it now...)

try these and see if they make a difference...

HTH

--Geoff



-Original Message-
From: Caroline Kliegl
To: [EMAIL PROTECTED]
Sent: 2/8/01 5:57 PM
Subject: Newbie question to mod_perl and Apache::DBI 

Hi there,

I am new to mod_perl and currently trying to make use of Apache::DBI.

This is my enviroment:
Suse Linux 6.3, Apache 1.3.12, mod_perl 1.24 and Oracle 8i. I am using
HTML:Mason as well, as a templating system. Everything works.
Apache::DBI is loaded via httpd.conf by Apache properly and I can make
use
of it in my scripts, when reading data.

With my other script, updating data, I get the following error :

Rebuild with -DPERL_STACKED_HANDLERS to $r-push_handlers at
/usr/local/lib/perl5/site_perl/5.6.0/Apache/DBI.pm line 93.

and the script does not get to connect the database and dies with a
timeout.

I think, I should add, that in both scripts, the one who is reading and
the
one who is updating, I open and close a $dbh (connect / disconnect).

Anybody having an idea, what I am doing wrong ? Or where to find help ?

Thanks for the help.

Caro



-- 
--
Caroline Kliegl
Neustadt - Germany

Sent through GMX FreeMail - http://www.gmx.net



RE: Newbie question to mod_perl and Apache::DBI

2001-02-08 Thread Geoffrey Young

 yup, it's a bug...

#!/usr/bin/perl

use Apache::MyConfig;

my $r = shift;

$r-send_http_header('text/plain');
print "can push_handlers\n" if Apache-can('push_handlers');
print "but PERL_STACKED_HANDLERS: ",
  $Apache::MyConfig::Setup{PERL_STACKED_HANDLERS};


basically Apache-can('push_handlers') returns true even if
PERL_STACKED_HANDLERS=0 at build time...

I guess that at some point this worked correctly, otherwise Edmund wouldn't
have coded it that way?

--Geoff


-Original Message-
From: Geoffrey Young
To: 'Caroline Kliegl '
Cc: '[EMAIL PROTECTED]'
Sent: 2/8/01 7:52 PM
Subject: RE: Newbie question to mod_perl and Apache::DBI 

Apache::DBI will call push_handlers on to issue a rollback if
AutoCommit=0
in your connect string...

but the problem may not be with you... looks like a bug (somewhere):

if(!$Rollback{$Idx} and $needCleanup and Apache-can('push_handlers'){ 
  ...
}
 
looks like calling Apache-can('push_handlers') is returning true even
though you didn't activate PERL_STACKED_HANDLERS.  I wonder if somehow
can()
isn't correctly capturing the build-time arguments (something to look
into...)

at any rate, the quickest way to fix this is to rebuild mod_perl with
EVERYTHING=1 or PERL_STACKED_HANDLERS=1 (or don't set AutoCommit=0 in
your
connect string if you can't rebuild it now...)

try these and see if they make a difference...

HTH

--Geoff



-Original Message-
From: Caroline Kliegl
To: [EMAIL PROTECTED]
Sent: 2/8/01 5:57 PM
Subject: Newbie question to mod_perl and Apache::DBI 

Hi there,

I am new to mod_perl and currently trying to make use of Apache::DBI.

This is my enviroment:
Suse Linux 6.3, Apache 1.3.12, mod_perl 1.24 and Oracle 8i. I am using
HTML:Mason as well, as a templating system. Everything works.
Apache::DBI is loaded via httpd.conf by Apache properly and I can make
use
of it in my scripts, when reading data.

With my other script, updating data, I get the following error :

Rebuild with -DPERL_STACKED_HANDLERS to $r-push_handlers at
/usr/local/lib/perl5/site_perl/5.6.0/Apache/DBI.pm line 93.

and the script does not get to connect the database and dies with a
timeout.

I think, I should add, that in both scripts, the one who is reading and
the
one who is updating, I open and close a $dbh (connect / disconnect).

Anybody having an idea, what I am doing wrong ? Or where to find help ?

Thanks for the help.

Caro



-- 
--
Caroline Kliegl
Neustadt - Germany

Sent through GMX FreeMail - http://www.gmx.net



RE: Newbie question to mod_perl and Apache::DBI

2001-02-08 Thread Caroline Kliegl

Hi everybody,

I have just removed 

RaiseError = 1,
AutoCommit = 0

out of my DBI-connect. No more errors, ORA works!

Next, I will recompile mod_perl with PERL_STACKED_HANDLERS = 1. 

Will come up with the result today.

Thanks a lot, everybody!


Caro



-- 
--
Caroline Kliegl
Neustadt - Germany

Sent through GMX FreeMail - http://www.gmx.net




Re: Newbie question on Apache::Debug::dump

2000-08-19 Thread Craig McLane

The request object is $r

Craig


On Sat, 19 Aug 2000, Jay Strauss wrote:

 Sorry if this has been asked before but I have been unable to find the answer
 (not in perldoc, apache modules book, searching archives):
 
 I would like my perl compilation and process errors to be written to an HTML
 page if/when they occur, in the same way they are written to stdout when I run
 from the command line.
 
 I thought that Apache::Debug::dump would do this, am I correct??
 
 I am unable to make it work though.  I can't seem to find any examples of how to
 use it, perldoc is too brief for my limited skills, the apache modules book
 (eagle) says:
 
 "The three arguments to dump() are the request object, an error code to return
 to Apache... and an error message..."
 
 What is a "request object"?
 
 No matter what I do, all I can produce is that "OK" server error page.  My perl
 code is a simple: give userid, password, database, sql query, connect to my
 database (oracle) and display the results.
 
 Can someone please give me an example of how to use dump()? Or if you have a
 different suggestion.
 
 Appended is my simple perl code and HTML error page
 
 Thanks
 Jay




RE: newbie question - require

2000-05-15 Thread Graf, Chris

Check the mod_perl guide for the usage of require() and do(). You probably
want to use do() instead of require().

Chris


-Original Message-
From: Brett Lee [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 15, 2000 7:56 AM
To: [EMAIL PROTECTED]
Subject: newbie question - require

In moving from CGI.pm to mod_perl, I ran across the common error with
functions that exist in scripts pulled in with 'require'.
Mod_perl_traps.html had the solution.  Similarly, am using ('require')
another file which holds all the hash tables (countries, states, etc.)
that my scripts need to reference.  It appeared to work fine in CGI.pm,
but with mod_perl, the info in the hash tables seems to be found "every
other refresh" (which has me stumped).

Would anyone be able to suggest a solution or reading material on this?

Thanks in advance.
-Brett



Re: newbie question - require

2000-05-15 Thread w trillich

Brett Lee wrote:
 but with mod_perl, the info in the hash tables seems to be found "every
 other refresh" (which has me stumped).
 
 Would anyone be able to suggest a solution or reading material on this?

don't forget to check your stuff out with single-process mode,
via 'apachectl stop; apache -X'; if it's acting sporadically in
your browser, it may be because you're talking to different child 
apache servers, each in its own state of affairs...

http://perl.apache.org/guide/porting.html#Sometimes_it_Works_Sometimes_it



Re: Newbie Question -

2000-05-12 Thread Doug MacEachern

On Sat, 6 May 2000, Gunther Birznieks wrote:

 At 06:56 PM 5/5/00 -0400, Jim Winstead wrote:
 On May 05, Adi wrote:
   You can still use CGI.pm from within mod_perl (and you should).  There is
   nothing better at handling data passed from a browser via HTTP POST and/or
   GET.  If you currently use CGI.pm, I think you'll find that a lot of your
   current code can simply be cut-and-pasted into a mod_perl setup.
 
 Well, arguably Apache::Request is better at handling data passed
 from a browser via HTTP POST and/or GET in a mod_perl environment.
 And it has the advantage that is entirely focused on request
 handling, and doesn't have any of the HTML generation cruft like
 CGI.pm.
 
 The "HTML Generation cruft" is optional "cruft" and doesn't have to be 
 compiled in.

not compiled, but the all the code lives in a BIG hash table for CGI.pm to
autoload from.  the export lists take up alot of space too.  regardless if
you're using html routines or not.




Re: Newbie Question -

2000-05-12 Thread Stas Bekman

On Fri, 12 May 2000, Doug MacEachern wrote:

 On Sat, 6 May 2000, Gunther Birznieks wrote:
 
  At 06:56 PM 5/5/00 -0400, Jim Winstead wrote:
  On May 05, Adi wrote:
You can still use CGI.pm from within mod_perl (and you should).  There is
nothing better at handling data passed from a browser via HTTP POST and/or
GET.  If you currently use CGI.pm, I think you'll find that a lot of your
current code can simply be cut-and-pasted into a mod_perl setup.
  
  Well, arguably Apache::Request is better at handling data passed
  from a browser via HTTP POST and/or GET in a mod_perl environment.
  And it has the advantage that is entirely focused on request
  handling, and doesn't have any of the HTML generation cruft like
  CGI.pm.
  
  The "HTML Generation cruft" is optional "cruft" and doesn't have to be 
  compiled in.
 
 not compiled, but the all the code lives in a BIG hash table for CGI.pm to
 autoload from.  the export lists take up alot of space too.  regardless if
 you're using html routines or not.

As I have replied to FEITO Nazareno today, this happens only if you
precompile CGI.pm's functions at the server startup. I've used B::Terse in
/perl-status to check that. Refer to the post with subject "[iso-8859-1]
Whats better?program with C" for a complete showcase.

If you don't precompile them, only the minumum set of functions will be
inherited, so it's possible to exclude the html generation functions.

__
Stas Bekman | JAm_pH--Just Another mod_perl Hacker
http://stason.org/  | mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]  | http://perl.orghttp://stason.org/TULARC/
http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org
--





Re: Newbie Question -

2000-05-12 Thread Doug MacEachern

  not compiled, but the all the code lives in a BIG hash table for CGI.pm to
  autoload from.  the export lists take up alot of space too.  regardless if
  you're using html routines or not.
 
 As I have replied to FEITO Nazareno today, this happens only if you
 precompile CGI.pm's functions at the server startup. I've used B::Terse in
 /perl-status to check that. Refer to the post with subject "[iso-8859-1]
 Whats better?program with C" for a complete showcase.
 
 If you don't precompile them, only the minumum set of functions will be
 inherited, so it's possible to exclude the html generation functions.

re-read what i said, i'm talking about variables in CGI.pm like
%EXPORT_TAGS, %SUBS, etc.




Re: Newbie Question -

2000-05-09 Thread Drew Taylor

Peter Haworth wrote:
 
 Drew Taylor wrote:
  What I would really like is a module which subclasses Apache::Request,
  and has the popup_menu, scrolling_list, and checkbox group methods
  available. That way I can use the smaller (faster) Apache::Request and
  still have the few HTML generation methods that I need. This would be
  similar to Apache::RequestNotes. One day I'll actually do it when I
  convert my CGI scripts to perl handlers...
 
 I've written one, but to get it released on CPAN would mean months of legal
 wrangling, which I'm already going through with my shared cache module.
 It's easy enough to write for yourself though. Plus you get to restrict the API
 to one style which makes your code much simpler and faster than CGI.pm
I'm quite sure it would be an easy write, but I just haven't done it
yet. I think once I convert my CGIs to handlers, it makes sense to do it
then. It would be interesting to see if anyone else is interested and
work out an API for the most commonly used methods. I work in a small
shop, so it would probably not be a big deal to get any resulting code
released to the world. Of course, then I have to learn how to create a
distributible package... :-)

-- 
Drew Taylor
Vialogix Communications, Inc.
501 N. College Street
Charlotte, NC 28202
704 370 0550
http://www.vialogix.com/



Re: Newbie Question -

2000-05-09 Thread Peter Haworth

Drew Taylor wrote:
 What I would really like is a module which subclasses Apache::Request,
 and has the popup_menu, scrolling_list, and checkbox group methods
 available. That way I can use the smaller (faster) Apache::Request and
 still have the few HTML generation methods that I need. This would be
 similar to Apache::RequestNotes. One day I'll actually do it when I
 convert my CGI scripts to perl handlers...

I've written one, but to get it released on CPAN would mean months of legal
wrangling, which I'm already going through with my shared cache module.
It's easy enough to write for yourself though. Plus you get to restrict the API
to one style which makes your code much simpler and faster than CGI.pm

-- 
Peter Haworth   [EMAIL PROTECTED]
"Psychos do not explode when sunlight hits them.
 I don't give a f**k how crazy they are."
-- Seth Gecko, _From Dusk Till Dawn_




RE: Newbie Question -

2000-05-09 Thread Geoffrey Young



 -Original Message-
 From: Drew Taylor [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, May 09, 2000 9:08 AM
 To: Peter Haworth
 Cc: [EMAIL PROTECTED]
 Subject: Re: Newbie Question -
 
 
 Peter Haworth wrote:
  
  Drew Taylor wrote:
   What I would really like is a module which subclasses 
 Apache::Request,
   and has the popup_menu, scrolling_list, and checkbox group methods
   available. That way I can use the smaller (faster) 
 Apache::Request and
   still have the few HTML generation methods that I need. 
 This would be
   similar to Apache::RequestNotes. One day I'll actually do 
 it when I
   convert my CGI scripts to perl handlers...
  
  I've written one, but to get it released on CPAN would mean 
 months of legal
  wrangling, which I'm already going through with my shared 
 cache module.
  It's easy enough to write for yourself though. Plus you get 
 to restrict the API
  to one style which makes your code much simpler and faster 
 than CGI.pm
 I'm quite sure it would be an easy write, but I just haven't done it
 yet. I think once I convert my CGIs to handlers, it makes 
 sense to do it
 then. It would be interesting to see if anyone else is interested and
 work out an API for the most commonly used methods. I work in a small
 shop, so it would probably not be a big deal to get any resulting code
 released to the world. Of course, then I have to learn how to create a
 distributible package... :-)

for guidance on how to contribute your stuff, read
http://perl.apache.org/src/apache-modlist.html

specifically:

HINT: For a nice set of template files try this: 

% h2xs -AX -n Apache::YourPackageName

HTH

--Geoff

 
 -- 
 Drew Taylor
 Vialogix Communications, Inc.
 501 N. College Street
 Charlotte, NC 28202
 704 370 0550
 http://www.vialogix.com/
 



Re: Newbie Question -

2000-05-09 Thread Drew Taylor

Geoffrey Young wrote:

  Drew Taylor wrote:
  I'm quite sure it would be an easy write, but I just haven't done it
  yet. I think once I convert my CGIs to handlers, it makes
  sense to do it
  then. It would be interesting to see if anyone else is interested and
  work out an API for the most commonly used methods. I work in a small
  shop, so it would probably not be a big deal to get any resulting code
  released to the world. Of course, then I have to learn how to create a
  distributible package... :-)
 
 for guidance on how to contribute your stuff, read
 http://perl.apache.org/src/apache-modlist.html
 
 specifically:
 
 HINT: For a nice set of template files try this:
 
 % h2xs -AX -n Apache::YourPackageName
I'll be sure to remember that. Thanks for the pointer. Hopefully I can
contribute something back to the community. After all, it gave me
mod_perl. :-)

-- 
Drew Taylor
Vialogix Communications, Inc.
501 N. College Street
Charlotte, NC 28202
704 370 0550
http://www.vialogix.com/



RE: Newbie Question -

2000-05-08 Thread Geoffrey Young



 -Original Message-
 From: Doug MacEachern [mailto:[EMAIL PROTECTED]]
 Sent: Friday, May 05, 2000 6:22 PM
 To: Geoffrey Young
 Cc: 'Pierre J. Nicolas'; [EMAIL PROTECTED]
 Subject: RE: Newbie Question -
 
 
  
  mod_perl overrides the perl print() function - print()ing to STDOUT
  explititly will not work.
  just use print() if you can...
 
 sure it will,
 
 print STDOUT "hi";
 
 and
 
 print "hi";
 
 are the same thing, provided STDOUT is the currently selected output
 filehandle, which it is by default.

ack, I swore I tried this just last week and it didn't work - clearly is
does.

Sorry for the misinformation...

--Geoff
 



Re: Newbie Question -

2000-05-08 Thread Drew Taylor

Adi wrote:
 
 Jim Winstead wrote:
 
  On May 05, Adi wrote:
   You can still use CGI.pm from within mod_perl (and you should).  There is
   nothing better at handling data passed from a browser via HTTP POST and/or
   GET.  If you currently use CGI.pm, I think you'll find that a lot of your
   current code can simply be cut-and-pasted into a mod_perl setup.
 
  Well, arguably Apache::Request is better at handling data passed
  from a browser via HTTP POST and/or GET in a mod_perl environment.
  And it has the advantage that is entirely focused on request
  handling, and doesn't have any of the HTML generation cruft like
  CGI.pm.
 
 Wow, I wasn't aware of Apache::Request.. thanks for letting me know.
What I would really like is a module which subclasses Apache::Request,
and has the popup_menu, scrolling_list, and checkbox group methods
available. That way I can use the smaller (faster) Apache::Request and
still have the few HTML generation methods that I need. This would be
similar to Apache::RequestNotes. One day I'll actually do it when I
convert my CGI scripts to perl handlers...

-- 
Drew Taylor
Vialogix Communications, Inc.
501 N. College Street
Charlotte, NC 28202
704 370 0550
http://www.vialogix.com/



RE: Newbie Question

2000-05-05 Thread Geoffrey Young

you'll find a great many questions answered in the mod_perl guide...

http://perl.apache.org/guide/troubleshooting.html#Undefined_subroutine_Apach
e_RO

--Geoff

 -Original Message-
 From: Pierre J. Nicolas [mailto:[EMAIL PROTECTED]]
 Sent: Friday, May 05, 2000 10:15 AM
 To: [EMAIL PROTECTED]
 Subject: Newbie Question
 
 
 Good Morning,
 
 I just started using mod_perl, could someone please tell me why
 I would get an error:
 "Undefined subroutine Apache::ROOT::dir::prog_name::function_name
 called at
 /path/to/script/script_name line line_numer"
 when I specifically  "require module_with_function_name" in 
 the script.
 
 I am using Apache::Registry.
 
 Thanks,
 
 Pierre
 



Re: Newbie Question -

2000-05-05 Thread Doug MacEachern

On Fri, 5 May 2000, Pierre J. Nicolas wrote:

 Good Morning,
 
 I just started using mod_perl, I'm still using the CGI.pm module, but I
 plan
 to convert.  I've loaded the Apache::Registry and I'm experiencing a
 strange
 problem.
 
 I have this snippet:
 
print "Content-Type: text/html\n\n";
print_template(file_handle, *file_handle_ref) {
  open file_handle()
  while (file_handle()) {
manipulate current_line
print file_handle_ref
 current_line
   }
}
 
 where "*file_handle_ref" could be a reference to STDOUT,
 this snippet worked fine, but now it stopped working, instead
 I get the message "The document contained no data"

are you saying you re-open STDOUT?  if so, you break the tie to the
browser.  but, i don't understand the code you've posted, if you have a
tiny example that we can actually run, we should be able to see the
problem.




RE: Newbie Question -

2000-05-05 Thread Doug MacEachern

 
 mod_perl overrides the perl print() function - print()ing to STDOUT
 explititly will not work.
 just use print() if you can...

sure it will,

print STDOUT "hi";

and

print "hi";

are the same thing, provided STDOUT is the currently selected output
filehandle, which it is by default.




Re: Newbie Question -

2000-05-05 Thread Adi

"Pierre J. Nicolas" wrote:
 
 Good Morning,
 
 I just started using mod_perl, I'm still using the CGI.pm module, but I
 plan
 to convert.

You can still use CGI.pm from within mod_perl (and you should).  There is
nothing better at handling data passed from a browser via HTTP POST and/or
GET.  If you currently use CGI.pm, I think you'll find that a lot of your
current code can simply be cut-and-pasted into a mod_perl setup.

-Adi




Re: Newbie Question -

2000-05-05 Thread Jim Winstead

On May 05, Adi wrote:
 You can still use CGI.pm from within mod_perl (and you should).  There is
 nothing better at handling data passed from a browser via HTTP POST and/or
 GET.  If you currently use CGI.pm, I think you'll find that a lot of your
 current code can simply be cut-and-pasted into a mod_perl setup.

Well, arguably Apache::Request is better at handling data passed
from a browser via HTTP POST and/or GET in a mod_perl environment.
And it has the advantage that is entirely focused on request
handling, and doesn't have any of the HTML generation cruft like
CGI.pm.

(But you are certainly correct in saying that you can continue to
use CGI.pm with mod_perl.)

Jim



Re: Newbie Question -

2000-05-05 Thread Adi

Jim Winstead wrote:
 
 On May 05, Adi wrote:
  You can still use CGI.pm from within mod_perl (and you should).  There is
  nothing better at handling data passed from a browser via HTTP POST and/or
  GET.  If you currently use CGI.pm, I think you'll find that a lot of your
  current code can simply be cut-and-pasted into a mod_perl setup.
 
 Well, arguably Apache::Request is better at handling data passed
 from a browser via HTTP POST and/or GET in a mod_perl environment.
 And it has the advantage that is entirely focused on request
 handling, and doesn't have any of the HTML generation cruft like
 CGI.pm.

Wow, I wasn't aware of Apache::Request.. thanks for letting me know.



Re: Newbie Question -

2000-05-05 Thread Gunther Birznieks

At 06:56 PM 5/5/00 -0400, Jim Winstead wrote:
On May 05, Adi wrote:
  You can still use CGI.pm from within mod_perl (and you should).  There is
  nothing better at handling data passed from a browser via HTTP POST and/or
  GET.  If you currently use CGI.pm, I think you'll find that a lot of your
  current code can simply be cut-and-pasted into a mod_perl setup.

Well, arguably Apache::Request is better at handling data passed
from a browser via HTTP POST and/or GET in a mod_perl environment.
And it has the advantage that is entirely focused on request
handling, and doesn't have any of the HTML generation cruft like
CGI.pm.

The "HTML Generation cruft" is optional "cruft" and doesn't have to be 
compiled in.


__
Gunther Birznieks ([EMAIL PROTECTED])
Extropia - The Web Technology Company
http://www.extropia.com/




Re: newbie question: extra Content-Type headers?

2000-02-05 Thread Wendell

On Fri, Feb 04, 2000 at 06:21:21PM -0800, John Darrow wrote:
 I apologize if this is a dumb question, but I just installed Apache and
 mod_perl and all seems to have gone well.  The trouble comes in when I try
 to run a script using Apache::Registry and CGI.pm.  I get an extra
 Content-Type in the resulting page, and I can't figure out where it's coming
 from.
[snipped the rest]

perldoc cgi_to_mod_perl

search the pod for "PerlSendHeader"

- wendell



Re: newbie question: extra Content-Type headers?

2000-02-05 Thread Stas Bekman

 On Fri, Feb 04, 2000 at 06:21:21PM -0800, John Darrow wrote:
  I apologize if this is a dumb question, but I just installed Apache and
  mod_perl and all seems to have gone well.  The trouble comes in when I try
  to run a script using Apache::Registry and CGI.pm.  I get an extra
  Content-Type in the resulting page, and I can't figure out where it's coming
  from.
 [snipped the rest]
 
 perldoc cgi_to_mod_perl
 
 search the pod for "PerlSendHeader"

CGI.pm long ago has become mod_perl aware. If you remove PerlSendHeader,
other scripts that don't use CGI.pm won't work correctly. 

Upgrade CGI.pm as suggested by Brian and your problem will disappear.

___
Stas Bekmanmailto:[EMAIL PROTECTED]  http://www.stason.org/stas
Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC
perl.apache.orgmodperl.sourcegarden.org   perlmonth.comperl.org
single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com



RE: newbie question: extra Content-Type headers?

2000-02-05 Thread John Darrow

Thanks.  Upgrading to 2.56 did fix it.  My system still had CGI version
2.36.

-john.

 -Original Message-
 From: Stas Bekman [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, February 05, 2000 1:33 AM
 To: Wendell
 Cc: John Darrow; [EMAIL PROTECTED]
 Subject: Re: newbie question: extra Content-Type headers?


  On Fri, Feb 04, 2000 at 06:21:21PM -0800, John Darrow wrote:
   I apologize if this is a dumb question, but I just installed
 Apache and
   mod_perl and all seems to have gone well.  The trouble comes
 in when I try
   to run a script using Apache::Registry and CGI.pm.  I get an extra
   Content-Type in the resulting page, and I can't figure out
 where it's coming
   from.
  [snipped the rest]
 
  perldoc cgi_to_mod_perl
 
  search the pod for "PerlSendHeader"

 CGI.pm long ago has become mod_perl aware. If you remove PerlSendHeader,
 other scripts that don't use CGI.pm won't work correctly.

 Upgrade CGI.pm as suggested by Brian and your problem will disappear.

 ___
 Stas Bekmanmailto:[EMAIL PROTECTED]  http://www.stason.org/stas
 Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC
 perl.apache.orgmodperl.sourcegarden.org   perlmonth.comperl.org
 single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com




Re: newbie question: extra Content-Type headers?

2000-02-04 Thread Bill Moseley

At 06:21 PM 02/04/00 -0800, John Darrow wrote:
I apologize if this is a dumb question, but I just installed Apache and
mod_perl and all seems to have gone well.  The trouble comes in when I try
to run a script using Apache::Registry and CGI.pm.  I get an extra
Content-Type in the resulting page, and I can't figure out where it's coming
from.

What version of CGI.pm are you running?  Might try upgrading.

Or try turning PerlSendHeader Off.



Bill Moseley
mailto:[EMAIL PROTECTED]



Re: Newbie Question

2000-02-02 Thread Samuel Beam


I am a relative newbie to mod_perl myself, but - I would think if you just want "a 
script to handle forms" that a vanilla CGI would be cake to set up and sufficient for 
your needs unless you get huge traffic. And I am led to think that if you just loaded 
ActivePerl then you are a long way from having mod_perl installed anyway. Have you 
recompiled Apache etc.?

-S



At 01:58 PM 2/2/00 +1000, you wrote:
Thanks for your responses so far,

I know I have a lot of reading to do but I just thought I would add this to
my first post.

After loading Activeperl I changed the httpd.conf file by adding the
following:

Alias /perl/ c:/Program Files/Apache Group/Apache/cgi-bin
Location /perl
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
/Location
PerlModule Apache::Registry
PerlModule CGI
PerlSendHeader On

It was after adding this that the service refused to restart.

I will obviously have to read a whole lot more before this is going to work.
The annoying thing is that I just want to run a script to handle forms
seems like a hell of a lot of effort for such a simple request :)

Thanks all

Ian 


* 
Ian Ollier - [EMAIL PROTECTED] 
Systems Administrator 
Queensland Centre for Schizophrenia Research 
Wolston Park Hospital, Wolston Park Road 
Wacol QLD 4076 AUSTRALIA 
ph: +61 7 3271 8592 fax: +61 7 3271 8567 mobile: 0411145593 
website: http://www.qcsr.uq.edu.au 


Any opinions herein are my own and do not necessarily reflect my employer's
views. 
* 
 



Re: Newbie Question

2000-02-02 Thread Waldek Grudzien

 I am a relative newbie to mod_perl myself, but - I would think if you just
want "a script to handle forms" that a vanilla CGI would be cake to set up
and sufficient for your needs unless you get huge traffic. And I am led to
think that if you just loaded ActivePerl then you are a long way from having
mod_perl installed anyway. Have you recompiled Apache etc.?

Or just use already built Win Apache / PERL / mod_perl distribution :
ftp://theoryx5.uwinnipeg.ca/pub/other/

Regards,

Waldek Grudzien
_
http://www.uhc.lublin.pl/~waldekg/
University Health Care
Lublin/Lubartow, Poland
tel. +48 81 44 111 88
ICQ # 20441796

 I know I have a lot of reading to do but I just thought I would add this
to
 my first post.
 
 After loading Activeperl I changed the httpd.conf file by adding the
 following:
 
 Alias /perl/ c:/Program Files/Apache Group/Apache/cgi-bin
 Location /perl
 SetHandler perl-script
 PerlHandler Apache::Registry
 Options ExecCGI
 /Location
 PerlModule Apache::Registry
 PerlModule CGI
 PerlSendHeader On
 
 It was after adding this that the service refused to restart.
 
 I will obviously have to read a whole lot more before this is going to
work.
 The annoying thing is that I just want to run a script to handle
forms
 seems like a hell of a lot of effort for such a simple request :)




Re: Newbie Question

2000-02-01 Thread Victor Zamouline

Hi Ian,

 We run an NT Server using Apache Web Server and I want to run Perl scripts
 on our web site to handle our administration forms.

To get full advantage out of mod_perl, it is more interesting to use it on
UNIX machines. But, in this community, we will encourage you to use mod_perl
even if you are determined to use NT.

 I loaded the Activeperl software onto the server

With the ActivePerl distribution, you can run Perl scripts in plain CGI
mode, but you cannot use mod_perl.

 but then
 the service won't restart.

You should provide a complete technical description of your problem.

 I read a lot about the MOD-PERL but very little
 about what it is and how it works, is this my problem?

Yes. You should start by reading http://perl.apache.org/guide. Take your
time to read this document carefully.

 Is anyone willing to tell me in SIMPLE terms what i have to do to get
this
 thing working?

You should understand that mod_perl is a bridge between Perl and Apache,
which, apart from its technical excellence, allows Perl programmers to use
their Perl culture while configuring and programming their Web applications
not only at the application level (the script itself) but also at the system
level (the server, i.e. Apache).

Whether you use mod_perl or not, programming a Web application requires
understanding how the Web works and how http servers work. Reading
http://perl.apache.org/guide will attract your attention to mod_perl's major
ambitions.

Try to define what your application's ambition first of all, then look for
corresponding guidelines in that document.

Victor.