Hi all,

I've been working on this for awhile, and I still haven't been able to
figure it out.

Here's the script I'm executing:

#!/usr/bin/perl -w
#
# Originally Written by: Kenny Smith <[EMAIL PROTECTED]>
#

$|=1;
use strict ;
use DBI ;
use CGI ;
use CGI::Carp qw(fatalsToBrowser) ;
use HTML::Template ;

use Apache::Debug level => 9;
use Carp ();
eval { Carp::confess("init") };

my ( $PATH ) = '/usr/www/anathema/html/journals/' ;
$ENV{'HTML_TEMPLATE_ROOT'} = $PATH.'templates' ;

#my ( $ERROR ) = eval { do $PATH.'journal.msg' } ;
main( @ARGV );
exit;

sub main
{
   my ( $c , $DB_INFO , $template , $info ) ;

   $c = new CGI ;
   print $c->header() ;

   if ( ! defined ( $main::dbh ) ) {
      $DB_INFO = eval { do '/usr/www/anathema/lib/db.lib' } ;
      $main::dbh = DBI->connect( "DBI:mysql:$DB_INFO->{'NAME'}" ,
                                 $DB_INFO->{'USERNAME'} ,
                                 $DB_INFO->{'PASSWORD'} ) ;
   }

   print STDERR "Before get_preview_entry\n" ;
   $info = get_preview_entry( $c->param('nickname') ,
                              $c->param('tmpl_group') ,
                              $c->param('color_group') ) ;
   print STDERR "After get_preview_entry\n" ;
   print STDERR "H::T->new( filename => $info->{'T_FILENAME'} ,".
                "cache => 1 , die_on_bad_params => 0 ) ;\n";
   $template = HTML::Template->new( filename => $info->{'T_FILENAME'} ,
                                    cache => 1 ,
                                    die_on_bad_params => 0 ) ;
   print STDERR "After new()\n";
   $template->param( %{$info} ) ;
   print STDERR "After param()\n";
   print $template->output() ;
   print STDERR "After output()\n";
}

get_preview_entry() does a db call and returns a hashref of information.

The error log contains the following:

----------------------------------------
Apache::Debug: [level 9]
[Tue Sep  4 21:23:06 2001] [error] Compiled package
"Apache::ROOTwww_2ejournalscape_2ecom::preview_2emod_perl" for process 15074
Before get_preview_entry
After get_preview_entry
H::T->new( filename => style_big_bubble/single_entry.tmpl ,cache => 1 ,
die_on_bad_params => 0 ) ;
httpd in realloc(): warning: modified (chunk-) pointer.
Out of memory!
Callback called exit.
----------------------------------------

I'm running apache (1.3.19) in single process mode, as the debugging docs
suggest for mod_perl (1.25). I'm using perl 5.005_03 and H:T 2.3.


Here is the script that isn't working:

http://www.journalscape.com/preview.mod_perl?nickname=kenny&tmpl_group=2&col
or_group=7

If you go to the above url, it won't be very spectacular because nothing
will be printed to the screen.

Here is the script that is working:

http://www.journalscape.com/kenny/

The above url gets rewritten with mod_rewrite and calls
show_journal.mod_perl.

The different between them is that for some reason, the second url is
actually called via normal CGI instead of through mod_perl. That is a
different problem, however, I want to run the whole site via mod_perl for
performance reasons. Short version: Either, a) H::T is having a problem when
executed via mod_perl or b) mod_perl is having a problem called H::T->new().
Any help?

Kenny Smith
www.journalscape.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to