Re: [cgiapp] cgiapp with Net::Server

2008-03-09 Thread Mark Fuller
On Sat, Mar 8, 2008 at 3:05 AM, Torsten [EMAIL PROTECTED] wrote:

  I attached a little test application showing the problem.

I don't think the mailing list accepts/distributes attachments. If you
want to email it to me directly I can look at it.

Mark

#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] CGI::Application::Dispatch Install Issues

2008-03-09 Thread Lee Carmichael
Hello Todd, 


I had the same issues, see bug: 
http://rt.cpan.org/Public/Bug/Display.html?id=33498


I found that I needed to patch a Build.PL and Makefile.PL when Apache::Test 
wasn't installed.


There are patches attached to the bug, give them a try. I'm pretty confident 
they will work (that probably means something is mucked up with them :)


Good Luck,


Lee

- Original Message 
From: Todd Ross [EMAIL PROTECTED]
To: CGI Application cgiapp@lists.erlbaum.net
Sent: Friday, March 7, 2008 9:34:00 AM
Subject: [cgiapp] CGI::Application::Dispatch Install Issues

I've seen quite a few posts on this list concerning 
CGI::Application::Dispatch.  I'd like to try it out.  Installing it, 
however, seems to be a problem.  Since there is no README or INSTALL 
included in the archive, I'm following the normal Makefile.PL (or 
Build.PL) procedures.

[EMAIL PROTECTED]:~/perltemp/CGI-Application-Dispatch-2.12] ls
Build.PL Changes  lib  Makefile.PL  MANIFEST META.yml  
  tTODO
[EMAIL PROTECTED]:~/perltemp/CGI-Application-Dispatch-2.12] perl Makefile.PL
This module can optionally use Apache::Test to test the mod_perl 
functionality.
Undefined subroutine ExtUtils::MakeMaker::prompt called at Makefile.PL 
line 31, DATA line 547.
[EMAIL PROTECTED]:~/perltemp/CGI-Application-Dispatch-2.12] perl Build.PL
Can't locate object method new via package Module::Build (perhaps you 
forgot to load Module::Build?) at Build.PL line 2.

Is there a known problem with CGI::Application::Dispatch?  How have others 
installed this?

Since its complaining about not finding a MakeMaker sub, the version of 
MakeMaker I'm using is probably relevant:

[EMAIL PROTECTED]:~/perltemp/CGI-Application-Dispatch-2.12] perl 
-MExtUtils::MakeMaker -e 'print $ExtUtils::MakeMaker::VERSION\n'
6.30

The Perl version is also probably relevant:

[EMAIL PROTECTED]:~/perltemp/CGI-Application-Dispatch-2.12] perl -v

This is perl, v5.8.8 built for sun4-solaris

snip

I've installed 100s of CPAN modules using these procedures with this build 
of Perl, so I'm comfortable with my environment.

Todd

#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####







#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] CGI::Application::Dispatch Install Issues

2008-03-09 Thread Michael Peters
Todd Ross wrote:

 [EMAIL PROTECTED]:~/perltemp/CGI-Application-Dispatch-2.12] perl Makefile.PL
 This module can optionally use Apache::Test to test the mod_perl 
 functionality.
 Undefined subroutine ExtUtils::MakeMaker::prompt called at Makefile.PL 
 line 31, DATA line 547.

I'm curious about this one. I'm not sure which version of ExtUtils::MakeMaker
added prompt (it's in at least 6.31, but I don't know about 6.30). It works just
fine for me.

I am trying to be smarter than the average Makefile.PL, but I just seem to be
getting more trouble then it's work at this point. I'll probably just go back to
being dumb and not run the Apache/mod_perl tests unless the person already have
Apache::Test installed.

 [EMAIL PROTECTED]:~/perltemp/CGI-Application-Dispatch-2.12] perl Build.PL
 Can't locate object method new via package Module::Build (perhaps you 
 forgot to load Module::Build?) at Build.PL line 2.

You need to install Module::Build using CPAN.

 Is there a known problem with CGI::Application::Dispatch?  How have others 
 installed this?
 
 Since its complaining about not finding a MakeMaker sub, the version of 
 MakeMaker I'm using is probably relevant:
 
 [EMAIL PROTECTED]:~/perltemp/CGI-Application-Dispatch-2.12] perl 
 -MExtUtils::MakeMaker -e 'print $ExtUtils::MakeMaker::VERSION\n'
 6.30

Try upgrading your ExtUtils::MakeMaker.

 The Perl version is also probably relevant:
 
 [EMAIL PROTECTED]:~/perltemp/CGI-Application-Dispatch-2.12] perl -v
 
 This is perl, v5.8.8 built for sun4-solaris
 
 snip
 
 I've installed 100s of CPAN modules using these procedures with this build 
 of Perl, so I'm comfortable with my environment.

using the command line to install perl modules is so 2000 :) Have you tried the
CPAN shell?

-- 
Michael Peters
Plus Three, LP


#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] CGI::Application::Dispatch Install Issues

2008-03-09 Thread Michael Peters
Michael Peters wrote:

 I am trying to be smarter than the average Makefile.PL, but I just seem to be
 getting more trouble then it's work at this point. I'll probably just go back 
 to
 being dumb and not run the Apache/mod_perl tests unless the person already 
 have
 Apache::Test installed.

Ok, not instead of trying to use the toolchain to install Module::Build and then
Apache::Test (if you answered yes at the prompt) I'm just going to be really
dumb. If you have Apache::Test on your machine I will use it and run the
mod_perl tests as well as the CGI ones. Else I won't. And since apparently not
everyone has upgraded their toolchain to include Module::Build I'll include a
normal Makefile.PL in the distribution.

I do have to say though that it really bothers me to have to make my modules
work for people who don't want to bother with upgrading their toolchain :)

-- 
Michael Peters
Plus Three, LP


#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] CGI::Application::Dispatch Install Issues

2008-03-09 Thread Michael Peters
Michael Peters wrote:

 Ok, not instead of trying to use the toolchain to install Module::Build and 
 then
 Apache::Test (if you answered yes at the prompt) I'm just going to be really
 dumb. If you have Apache::Test on your machine I will use it and run the
 mod_perl tests as well as the CGI ones. Else I won't. And since apparently not
 everyone has upgraded their toolchain to include Module::Build I'll include a
 normal Makefile.PL in the distribution.

I forgot to mention that I just uploaded CGI::Application::Dispatch 2.13_01 to
CPAN. Since it's a dev release it won't be installable via the CPAN shell, so if
you want to see if it fixes your install issues, then you'll have to try it out
by hand.

-- 
Michael Peters
Plus Three, LP


#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




[cgiapp] Re: ValidateRM and dynamic content

2008-03-09 Thread Mark Stosberg


I am using HTML::Template and CGI::Application::Plugin::ValidateRM.
Page content is generated dynamically which works fine until a
validation error occurs.  Unfortunately err_TMPL_VAR field_name is
not valid H::T.


Could you provide a more complete example? I have been using ValidateRM
and H::T with complex websites for years and haven't gotten stuck here.
I suspect there's another way to accomplish your goal while still using
sing these tools.

Mark

--
http://mark.stosberg.com/



#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] cgiapp with Net::Server

2008-03-09 Thread Ron Savage
Hi Torsten

 I attached a little test application showing the problem. It simply

H. Odd. My email client - Evolution - shows a paperclip suggesting
that there is an attachment, but I can't otherwise see it.

I suggest you upload your demo to your web site and send the url in an
email msg to the list.
-- 
Ron Savage
[EMAIL PROTECTED]
http://savage.net.au/index.html



#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] cgiapp with Net::Server

2008-03-09 Thread Torsten
Hi Ron,

you are right, the mailing list removed the attachment.

I put it here:

http://www.tb-solutions.biz/stuff/http_test.tgz

  Torsten


Am Sun, 09 Mar 2008 10:04:48 +1100
schrieb Ron Savage [EMAIL PROTECTED]:

 Hi Torsten
 
  I attached a little test application showing the problem. It simply
 
 H. Odd. My email client - Evolution - shows a paperclip suggesting
 that there is an attachment, but I can't otherwise see it.
 
 I suggest you upload your demo to your web site and send the url in an
 email msg to the list.

#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] cgiapp with Net::Server

2008-03-09 Thread Mark Fuller
On Sat, Mar 8, 2008 at 4:04 PM, Ron Savage [EMAIL PROTECTED] wrote:
 Hi Torsten

Ron, Torsten emailed it to me yesterday. What I found is that it
doesn't work with N::S's PreFork personality. But, it works fine
with the Fork personality. So, it has something to do with how N::S
creates (and maintains) some children.

The next thing I found is that the environment contains the correct
runmode. But, the C::A instance thinks it's a different run mode. You
can add something to his webApp.pm to dump the environment and you'll
see it has rm=1 even though the method for runmode 2 is being
executed.

I was going to dump the query object and then discovered, if I do my
$q = $self-query() anywhere in webApp.pm, the problem disappears.

So, it seems like cgi.pm is persisting. But, I don't understand how.
I'm to the end of my capability. If you can figure it out it would be
interesting to know what's going on.

Mark

#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] CGI::Application::Dispatch Install Issues

2008-03-09 Thread Lee Carmichael
Hello Michael, 
 
  [EMAIL PROTECTED]:~/perltemp/CGI-Application-Dispatch-2.12]  perl  
 Makefile.PL 
  This  module  can  optionally  use  Apache::Test  to  test  the  mod_perl  
  functionality. 
  Undefined  subroutine  ExtUtils::MakeMaker::prompt  called  at  
 Makefile.PL  
  line  31,  DATA  line  547. 
 
 I'm  curious  about  this  one.  I'm  not  sure  which  version  of  
 ExtUtils::MakeMaker 
 added  prompt  (it's  in  at  least  6.31,  but  I  don't  know  about  
 6.30).  It  works  just 
 fine  for  me. 
 
This isn't a problem with ExtUtils::MakeMaker not having prompt in some old 
version, it is an issue with trying to use the 'prompt' sub before requiring 
the library. The require of it occurs only if you install module::build above, 
if you have it installed it makemaker won't get loaded.
 
snippet 
# see if they have Apache::Test, if not, ask if they want it 
my $build_pkg = 'Module::Build'; unless(eval use Apache::Test 1.30; 1) { 
   print This module can optionally use Apache::Test to test the mod_perl 
functionality.\n; 
   my $yn = ExtUtils::MakeMaker::prompt('  Install Apache::Test now from 
CPAN?', 'y');
/snippet
  
 I  am  trying  to  be  smarter  than  the  average  Makefile.PL,  but  I  
 just  seem  to  be 
 getting  more  trouble  then  it's  work  at  this  point.  I'll  probably  
 just  go  back  to 
 being  dumb  and  not  run  the  Apache/mod_perl  tests  unless  the  person  
 already  have 
 Apache::Test  installed. 

I think its nice to try this. These problems aren't anything major.
 
  [EMAIL PROTECTED]:~/perltemp/CGI-Application-Dispatch-2.12]  perl  
 Build.PL 
  Can't  locate  object  method  new  via  package  Module::Build  
 (perhaps  you  
  forgot  to  load  Module::Build?)  at  Build.PL  line  2. 
 
 You  need  to  install  Module::Build  using  CPAN. 

I had Module::Build installed, the problem was w/out apache::testmb it didn't 
try to require or use it.


Here is the snippet from the Build.PL:


my $build_pkg = eval require Apache::TestMB ? 'Apache::TestMB' : 
'Module::Build';
my $build = $build_pkg-new( ...


If you notice Module::Build is never loaded.

   Is  there  a  known  problem  with  CGI::Application::Dispatch?   How  have 
   others  
  installed  this? 


I had these same issues but once I patched the Makefile.PL and Build.PL it 
worked just fine.


These are really small things and nothing to get angry about. Thanks for your 
work on C:A:Dispatch, it is a great tool. 


Take Care,


Lee


#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] cgiapp with Net::Server

2008-03-09 Thread Ron Savage
Hi Mark

The sample code uses Net::Server::PreFork. I'm not sure, but if you have
multiple server processes waiting for connexions, it's possible the
first run mode is run inside one process, and the second run mode is run
inside a different process, right? That would explain how a run mode is
fixed inside a given process.
-- 
Ron Savage
[EMAIL PROTECTED]
http://savage.net.au/index.html



#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] cgiapp with Net::Server

2008-03-09 Thread Mark Fuller
On Sun, Mar 9, 2008 at 4:17 PM, Ron Savage [EMAIL PROTECTED] wrote:
  The sample code uses Net::Server::PreFork. I'm not sure, but if you have
  multiple server processes waiting for connexions, it's possible the
  first run mode is run inside one process, and the second run mode is run
  inside a different process, right? That would explain how a run mode is
  fixed inside a given process.

I don't know. But, each process has the correct environment. For
example if you add print $ENV{REQUEST_URI} to Turston's WebApp.pm
(in each run-mode method), it will show that the URI has the correct
run mode. But, that's *not* the runmode C:A knows about.

It seems like CGI.pm is remaining persistent. But, I don't understand
why because the WebApp.pm is created new each time.

And, like I said, if you add my $q = $self-query() somewhere in
WebApp.pm the odd behavior stops. It also stops if I add a
cgiapp_get_query method to use CGI::Simple.

Turston's ok with using fork instead of PreFork. It's still puzzling
though. And beyond my capability to figure out.

Mark

#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] Test Failures with CGI::Application::Plugin::TT

2008-03-09 Thread Cees Hek
Hi Michael,

I knew about these problems already because of the amazing CPAN
testers.  However, I was waiting for someone to pipe up that might
help me in solving the problems :)

The first two problems look to be cosmetic issues in Template Toolkit
(ie it is using the wrong path separator on windows).  My guess is
that this doesn't actually cause any problems, but we should be able
to fix the test suite to account for it.

Like you said, the third problem looks like it could be an issue
(although it is only an issue with the new precompile feature, so
upgrading on windows should still be safe if you avoid that new
feature).  I don't have a windows box to play with so there is not
much I can do to fix this.  I would appreciate if someone could take a
few minutes to do some debugging.  A patch would be greatly
appreciated, and/or SVN access to my CAP::TT repo can be organized for
anyone willing to put in a bit of time to fix this problem.

Cheers,

Cees


On Wed, Mar 5, 2008 at 1:39 AM, Michael Lackhoff
[EMAIL PROTECTED] wrote:
 Hello Cees,

  thanks for the new versions of your plugins. Everything looks fine with
  a tiny exception:

  t/09_precompile_dir..1/6
  #   Failed test 'file is cached'
  #   at t/09_precompile_dir.t line 31.
  #  got: 'C:\.cpan\build\CGI-Application-Plugin-TT-
  1.04\t\include1\TestAppIncludePath/test_mode.tmpl'
  # expected: 'C:\.cpan\build\CGI-Application-Plugin-TT-
  1.04\t\include1\TestAppIncludePath\test_mode.tmpl'

  #   Failed test 'file is cached'
  #   at t/09_precompile_dir.t line 31.
  #  got: 'C:\.cpan\build\CGI-Application-Plugin-TT-
  1.04\t\include1\TestAppIncludePath/test_mode.tmpl'
  # expected: 'C:\.cpan\build\CGI-Application-Plugin-TT-
  1.04\t\include1\TestAppIncludePath\test_mode.tmpl'

  #   Failed test 'file is cached'
  #   at t/09_precompile_dir.t line 31.
  #  got: undef
  # expected: 'C:\.cpan\build\CGI-Application-Plugin-TT-
  1.04\t\include1\TestAppIncludePath\test_mode.tmpl'
  # Looks like you failed 3 tests of 6.
  t/09_precompile_dir.. Dubious, test returned 3 (wstat 768, 0x300)
   Failed 3/6 subtests

  It looks as if the first two are harmless (just one slash/backslash
  mixed up) but the third error looks like something is really going
  wrong.
  As you can guess from the C:\... everything is under Windows 2000,
  Perl is a self-compiled 5.8.8 with VC6 from the official sources (not
  Activestate).

  Any ideas?
  -Michael


  #  CGI::Application community mailing list  
  ####
  ##  To unsubscribe, or change your message delivery options,  ##
  ##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
  ####
  ##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
  ##  Wiki:  http://cgiapp.erlbaum.net/ ##
  ####
  



#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] cgiapp with Net::Server

2008-03-09 Thread Mark Fuller
Browsing the source for CGI.pm I noticed it calls
initialize_globals() when the class is loaded, but not when
instances are created. But, it does call it for each instance if the
mod_perl environment variable is set. (But, that does other things you
wouldn't want to do if you're not really using mod_perl). I also
noticed that it detects ActiveState's PerlEx (persistent Perl
utility) and calls _reset_globals which calls initialize_globals.

I added a teardown method to Torsten's WebApp.pm and called
$self-query()-initialize_globals(). The problem disappeared. (I
used teardown because that was the only place I could think to do it.
I guess a cgiapp_get_query would be more appropriate. Do the new and
then initialize_globals.).

So, it's definitely an issue with CGI.pm.  Apparently the params are
globals (class data). And, it doesn't have a catch-all persistence
flag. It has a flag for mod_perl. And, detects PerlEx. But, if you use
something else (like Net::Server's prefork) you're screwed.

CGI::Simple doesn't have this problem. The params aren't class data.
And, it calls initialize_globals with each instance (without going
through a bunch of questions about mod_perl or perlex). Reminds me why
I like CGI::Simple.

Mark

#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####