On Wed, Apr 28, 2004 at 03:55:23PM -0400, Alejandro Galue wrote: > > I tried this (inside the handler): > > ... > my $cmd = '/opt/reports/bin/getdata'; > system($cmd, @params); > if ( open(DATA, '/opt/reports/var/data.txt') ) { > local $_; > while (<DATA>) { $r->print($_) } > close DATA; > } else { > $r->print("<h1>Can?t read data</h1>"); > } > ... > > The program getdata put output in /opt/reports/var/data.txt
It may just be an example, but this handler doesn't create a unique file; it may get stomped my multiple invokations. Why not open(DATA, join(' ', $cmd, @params, '|') || croak "$cmd failed: $? $!\n"; if you're trying to avoid generating a text file. I wrote the System2 module to get STDERR and STDOUT returned in scalars (and avoid the Bourne shell); see if that'd be useful for you... my ($out, $err) = system2(@args); Are you checking on the exit status of your command? my ($exit_value, $signal_num, $dumped_core) = &System2::exit_status($?)? Good luck... -- Brian Reichert <[EMAIL PROTECTED]> 37 Crystal Ave. #303 Daytime number: (603) 434-6842 Derry NH 03038-1713 USA BSD admin/developer at large -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html