input from external process

2000-11-04 Thread Eric Smith

Hi

Is it possible to have an existing mod_perl application read from an
external process?  The case in point is procmail piping mails to the
mod_perl application.  With high volumes of email, we would prefer not
to have to launch the perl interpreter each time to perform the tasks
specified by the incoming email.

Nasty way of effecting this communication is to have each mail message
saved to a file and do a readdir every time interval.

Is it possible to have the mod_perl process listen on a socket (or
something) that procmail may write to?

-- 
Eric Smith
Fruitcom.com Amsterdam
Wire phone : +31 20 528 7340
Mobile: +31 6 241 259 16
www.fruitcom.com



Apache 1.3.12/mod_perl 1.23/Activestate Perl 5.6.0 and db persistance

2000-08-17 Thread Eric Smith

Looking for suggestion as to where we might find the problem in
getting a sample script implementing db persistance working with the
above config on a windows box.

Tries to follow the docs by the following:

 -- add to httpd.conf: 
 PerlModule Apache::DBI

and:

/mod_perl/persistantdbi.pl
==

use DBI (); 
use Apache::DBI;
use strict;

use vars qw($dbh);
use CGI;
my $cgi=new CGI;
use CGI::Carp 'fatalsToBrowser';

print $cgi-header;
print $cgi-start_html("Persistant Test");

use Win32::OLE::Variant;
use Win32::OLE;
use Win32::OLE::Const;
use DBD::ADO;
my $database = "db";
my $user = "port";
my $password = "ahem";
my $ADO_SQL_data_source =
"Provider=SQLOLEDB;Database=$database;Uid=$user;Pwd=$password;";

 $dbh ||= DBI-connect("dbi:ADO:$ADO_SQL_data_source"  )|| print "Error 111";

my $sth = $dbh-prepare('select description from grade');
$sth-execute() || print "error 555";
my @row;
while(@row=$sth-fetchrow) { print @row; }
print $cgi-end_html;

Now this works perfectly (like it prints the result of the sql) on the
first web access.  However when you reload or access again from
another machine or whatever, this in the browser:

HTTP/1.1 200 OK Date: Thu, 17 Aug 2000 22:31:40 GMT Server:
Apache/1.3.12 (Win32)   
   mod_perl/1.23 Connection: close Transfer-Encoding: chunked
Content-Type: text/html; 
   charset=iso-8859-1

and this is the error_log:

[Fri Aug 18 00:31:40 2000] nul: Win32::OLE(0.12): GetOleObject() Not a Win32::OLE 
object at C:/Perl/site/5.6.0/lib/Win32/OLE/Lite.pm line 148.
[Fri Aug 18 00:31:40 2000] nul: Win32::OLE(0.12): GetOleObject() Not a Win32::OLE 
object at C:/Perl/site/5.6.0/lib/Win32/OLE/Lite.pm line 148.
[Fri Aug 18 00:31:40 2000] [error] Can't call method "Clear" on an undefined value at 
C:/Perl/site/5.6.0/lib/DBD/ADO.pm line 47.

thanx
-- 
Eric Smith
Fruitcom.com
Landline: 00 27 21 426 5311
Mobile: 00 27 82 373 1224