[My apologies for two copies of my original message turning up.  My bad.]

In article <00a901c1a44d$7d087d70$18020c0a@PerriHar>,
   Perrin Harkins <[EMAIL PROTECTED]> wrote:

> I would not expect PerlRun to use less memory than Registry.

What I meant was that I have about a dozen of these little scripts.  My
understanding is that PerlRun uses the embedded Perl interpreter, but
compiles and executes the scripts individually on each request, whereas
Registry caches the compiled version, potentially meaning a dozen
compiled versions cached for each of a bunch of processes.  I figured
using PerlRun would avoid that, but provide a useful intermediate
performance boost by not forking perl each time.

Have I misunderstood?


> Does the module have a package name?  Are you exporting the variables
> from it?  Seeing some code would help.

It does, and what confuses me is the intermittent nature of the problem.

Anyway, here's some code (snipped wildly into a minimal test case, and
with the paths replaced):

The module:

   #!/usr/bin/perl
   
   package Article7::Woking::Overseer;
   
   use strict;
   require Exporter;
   use vars qw(@ISA @EXPORT $root $dbmx);
   
   @ISA = qw(Exporter);
   @EXPORT = qw($dbmx);

   $dbmx = 'path-to-data-files';
   
   1;


...and the PerlRun program:

   #!/usr/bin/perl
   
   use strict;
   use CGI qw(:standard);
   use Fcntl;
   use MLDBM qw(DB_File Storable);
   use lib 'path-to-directory';
   use Article7::Woking::Overseer;

   print header(-type => 'text/html; charset=utf-8');
   
   tie(my %accom, 'MLDBM', "$dbmx/accom.dbmx", O_RDONLY, 0644) or die
   "Can't open $dbmx/accom.dbmx: $!\n";

   [...]

The error log reveals that it's this tie that kills the program -- $dbmx
remains undef, so the file isn't found.


> >      200 OK

> That just means the error happened after the initial header was sent.

Ah, I see.  Yes, of course -- the first thing I do is send the header!


Thanks for the ref to the Guide -- I've looked through that section again
now, but I think I must be still missing something.  I'm afraid running
in single-server mode would be troublesome, as the server is in
production use for other sites.

Many thanks for your help,
Andrew.

-- 
"Mind you, you'd expect that of cows, wouldn't you?
Two stomachs, know what I mean?"                        -- Liza Tarbuck

Reply via email to