Re: Error in compile

2003-08-09 Thread Stas Bekman
The Doctor wrote:
Why is the below happening?
we need more info. please see:
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems
Script started on Fri Aug  8 20:20:56 2003
doctor.nl2k.ab.ca//usr/source/mod_perl-1.99_09$ make
cd src/modules/perl  make -f Makefile.modperl
rm -f mod_perl.so
ld -shared -x  -L/usr/X11/lib -L/usr/local/libmod_perl.lo modperl_interp.lo 
modperl_tipool.lo modperl_log.lo modperl_config.lo modperl_cmd.lo modperl_options.lo 
modperl_callback.lo modperl_handler.lo modperl_gtop.lo modperl_util.lo modperl_io.lo 
modperl_filter.lo modperl_bucket.lo modperl_mgv.lo modperl_pcw.lo modperl_global.lo 
modperl_env.lo modperl_cgi.lo modperl_perl.lo modperl_perl_global.lo 
modperl_perl_pp.lo modperl_sys.lo modperl_module.lo modperl_svptr_table.lo 
modperl_const.lo modperl_constants.lo modperl_apache_compat.lo modperl_hooks.lo 
modperl_directives.lo modperl_flags.lo modperl_xsinit.lo  -rdynamic 
-Wl,-rpath,/usr/libdata/perl5//CORE  -L/usr/X11/lib -L/usr/local/lib 
/usr/libdata/perl5/i386-bsdos/auto/DynaLoader/DynaLoader.a 
-L/usr/libdata/perl5/i386-bsdos/CORE -lperl -lutil -lbind -ldl -lm -lc  -o mod_perl.so
ld: -r and -shared may not be used together
*** Error code 1
Stop.
*** Error code 1
Stop.
doctor.nl2k.ab.ca//usr/source/mod_perl-1.99_09$ uname
BSD/OS
doctor.nl2k.ab.ca//usr/source/mod_perl-1.99_09$ uname -a
BSD/OS doctor.nl2k.ab.ca 4.3.1 BSDI BSD/OS 4.3.1 Kernel #8: Tue Jul 29 17:15:03 MDT 
2003 [EMAIL PROTECTED]:/usr/src/sys/compile/LOCALTYAN5  i386
doctor.nl2k.ab.ca//usr/source/mod_perl-1.99_09$ gcc -x v
Using builtin specs.
gcc version 2.95.3 20010315 (release)
doctor.nl2k.ab.ca//usr/source/mod_perl-1.99_09$ cc -v
Using builtin specs.
gcc version 2.95.3 20010315 (release)
doctor.nl2k.ab.ca//usr/source/mod_perl-1.99_09$ exit
exit
Script done on Fri Aug  8 20:21:21 2003

Pointers needed.



--

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: help on setting up a PerlFixupHandler

2003-08-09 Thread Geoffrey Young

So, while I'm not 100% sure about this, logically the $r-content_type
should be empty before the response is prepared to be sent to the browser,
so it should be empty in the Fixup stage.
not necessarily.

if you request index.html, mod_mime (at the mime-type phase) will set the 
content type to text/html based on the file extension.  mod_mime_magic will 
do the same, but by analyzing the contents of the file.

if you are generating dynamic content and there is no file type to examine 
(or consistently relate, as .cgi can produce multiple CTs), no default type, 
and no file to examine, then there is no way the mime modules can set a 
content type.  the end result would be undef in fixup and beyond.

In fact what I miss (and I guess I'm not alone ;-) is a documentation that
would take the $r from the newly born state and describe what's
added/deleted to it during a full process loop, at each stage.
there is lots of documentation on this kind of thing, but nothing specific 
like $r-content_type is set during the mime-type phase because things 
like this are dependent on varying circumstances.

Part III of the mod_perl Developer's Cookbook talks about the each phase of 
the request cycle in depth.  you can read part of it from 
http://www.modperlcookbook.org/.  the eagle book also covers it.

Besides I'd like to know about each major optional module (like mod_rewrite,
mod_ssl, etc) where they intervine in the loop and what they read/or set.
Most of these one can guess but I'm not aware of such a documentation.
that's complex.  for instance, mod_rewrite can enter just about every part 
of the request cycle, depending on how it's configured.

the way to discover this is to look at the code (remember, it's open :) - at 
the end of each extension module is the place where hooks are typically 
registered.  look for a line such as

module MODULE_VAR_EXPORT rewrite_module = {

which begins the list of phases the module hooks into.

HTH

--Geoff




Re: rflush() not working as documented?

2003-08-09 Thread Stas Bekman
Martin Wickman wrote:

Please try the latest mp2 cvs, I've added a new test t/api/rflush.t, it tests 
rflush explicitly (even though it's already used for exactly this purpose in 
several other tests).

It does exactly what your code does:

sub response {
my $r = shift;
# just to make sure that print() won't flush, or we would get the
# count wrong
local $| = 0;
$r-content_type('text/plain');
$r-print(foo);
$r-rflush; # this sends the data in the buffer + flush bucket
$r-print(bar);
$r-rflush; # this sends the data in the buffer + flush bucket
$r-print(who);
$r-rflush; # this sends the data in the buffer + flush bucket
$r-print(ah);
Apache::OK;
}
Then an output filter that brakets the data:

sub braket {
  my $filter = shift;
  my $data = '';

  while ($filter-read(my $buffer, 1024)) {
  $data .= $buffer;
  }
  $filter-print([$data]) if $data;

  return Apache::OK;
}
the response body is: [foo][bar][who][ah]

does it work for you? Is it any different from your code?

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Multiple select

2003-08-09 Thread Alan Rafagudinov
Hello!

I have the next html code:

select name=sel_name multiple
option Smth_1
...
option Smth_n
/select

User is able to select many values in the list, how can I get all of
them in my mod_perl script?

Thanx!
Good luck!



RE: PerlModule options?

2003-08-09 Thread Perrin Harkins
On Tue, 2003-08-05 at 15:57, [EMAIL PROTECTED] wrote:
 Thanks for your answer, this should do it indeed. Super! Somehow I didn't
 think about perl sections...

Perl sections will not work for this.  If you do it there, the symbols
you want will only get imported into the Apache::ReadConfig namespace. 
You will not be able to call them in other scripts without importing
them there too.

- Perrin


Re: How to pass parameters from the UNIX command line ?

2003-08-09 Thread Jean-Sebastien Guay
  http://server.domain.com/cgi-bin/MyProcedure.pl?cust_id=x
 
  I'd like to make a cron job to source the above PERL script as from
  the command line to resemble something like:
 
  perl /usr/local/apache/cgi-bin/MyProcedure.plneed to pass the
  parameter here as cust_id=x

 [...]
 Or use GET from the commandline with the uri behind it. This
 makes it a proper request to your webserver, issued from the command-
 line (or crontab in this case).

Or 'lynx -source
http://server.domain.com/cgi-bin/MyProcedure.pl?cust_id=x'

J-S

___
Jean-Sébastien Guay  [EMAIL PROTECTED]
Software Developer, Hybride http://www.hybride.com
Piedmont, Québec, Canada




RE: help on setting up a PerlFixupHandler

2003-08-09 Thread csebe
Well, thank you very much for the references.

I guess I'll have to skip next few pints and finally get that book I've
heard so much about ;-)

Lian Sebe, M.Sc.
Freelance Analyst-Programmer
www.programEz.net

 -Original Message-
 From: Geoffrey Young [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 07, 2003 3:15 PM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: help on setting up a PerlFixupHandler



 
  So, while I'm not 100% sure about this, logically the $r-content_type
  should be empty before the response is prepared to be sent to
 the browser,
  so it should be empty in the Fixup stage.

 not necessarily.

 if you request index.html, mod_mime (at the mime-type phase) will set the
 content type to text/html based on the file extension.
 mod_mime_magic will
 do the same, but by analyzing the contents of the file.

 if you are generating dynamic content and there is no file type
 to examine
 (or consistently relate, as .cgi can produce multiple CTs), no
 default type,
 and no file to examine, then there is no way the mime modules can set a
 content type.  the end result would be undef in fixup and beyond.

 
  In fact what I miss (and I guess I'm not alone ;-) is a
 documentation that
  would take the $r from the newly born state and describe what's
  added/deleted to it during a full process loop, at each stage.

 there is lots of documentation on this kind of thing, but nothing
 specific
 like $r-content_type is set during the mime-type phase because things
 like this are dependent on varying circumstances.

 Part III of the mod_perl Developer's Cookbook talks about the
 each phase of
 the request cycle in depth.  you can read part of it from
 http://www.modperlcookbook.org/.  the eagle book also covers it.

  Besides I'd like to know about each major optional module (like
 mod_rewrite,
  mod_ssl, etc) where they intervine in the loop and what they
 read/or set.
  Most of these one can guess but I'm not aware of such a documentation.

 that's complex.  for instance, mod_rewrite can enter just about
 every part
 of the request cycle, depending on how it's configured.

 the way to discover this is to look at the code (remember, it's
 open :) - at
 the end of each extension module is the place where hooks are typically
 registered.  look for a line such as

 module MODULE_VAR_EXPORT rewrite_module = {

 which begins the list of phases the module hooks into.

 HTH

 --Geoff