Return-Path: Mailing-List: contact embperl-help@perl.apache.org; run by ezmlm Delivered-To: mailing list embperl@perl.apache.org Received: (qmail 68928 invoked from network); 16 Jun 2000 12:47:58 -0000 Received: from accept.id.pl (qmailr@213.25.114.17) by locus.apache.org with SMTP; 16 Jun 2000 12:47:58 -0000 Received: (qmail 5719 invoked by uid 0); 16 Jun 2000 12:44:46 -0000 Received: from siaco.id.pl (213.25.114.8) by accept.id.pl with SMTP; 16 Jun 2000 12:44:46 -0000 Received: (qmail 9047 invoked by uid 1000); 16 Jun 2000 12:47:56 -0000 Resent-Message-ID: <20000616124756.9046.qmail@siaco.id.pl> Date: Fri, 16 Jun 2000 14:45:11 +0200 From: Ryszard Lach To: emberl@perl.apache.org Subject: Re: Beginner's question Message-ID: <20000616144511.B8626@id.pl> References: <20000615174730.A14962@id.pl> <000a01bfd75d$e019f0b0$0a0c0b0a@gr.ecos.de> <20000616085621.D467@id.pl> <394A1EF7.56E008E4@pace.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.0.1i In-Reply-To: <394A1EF7.56E008E4@pace.edu>; from emarkert@pace.edu on Fri, Jun 16, 2000 at 08:35:03AM -0400 Resent-From: siaco@id.pl Resent-Date: Fri, 16 Jun 2000 14:47:56 +0200 Resent-To: embperl@perl.apache.org X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N On Fri, Jun 16, 2000 at 08:35:03AM -0400, Erich L. Markert wrote: > Some things to notice... > > In your code you have: "qmail.log|" in your open() statement - I don't > think you want that if you are simply reading the file. No, I'm not reading the file, I'm reading output form /path/command Also, ALWAYS, ALWAY, ALWAYS close file handles via close() if you are > using open(). OK, OK, I always do close files (this time was a bad exception), and adding close(FILE) didn't help.... > > Ryszard Lach wrote: > > > > On Fri, Jun 16, 2000 at 08:41:18AM +0200, Gerald Richter wrote: > > > > > > > > open (FILE, "/path/command \ > > > > > > > while (\) { > > > > print OUT $_; > > > > } > > > > > > > > did not. I received Internal Server Error and the following in > > > > apache's error > > > > log: > > > > > > > > [Thu Jun 15 17:42:39 2000] [error] [client 192.168.1.66] > > > > malformed header from > > > > script. Bad header=: /usr/lib/cgi-bin/embpcgi.pl > > > > > > > > what means, embperl skipped all html stuff inserted before script > > > > part. Do you > > > > have any ideas? > > > > > > > > > > I would guess it's the other way round. Your command has, for whatever > > > reasons, printed directly to stdout (and that will come out before the > > > output from Embperl), instead of the redirection to . > > > > Well, I wouldn't say so. In this case the output would be seeable before static > > html tags, but it isn't. > > > > Look at this complete page code: > > > > ######################## > > > > > > Statystyki poczty - summary of senders > > > > > > > > [- > > $escmode = 0; > > open(FILE, "/usr/local/qmailanalog/bin/zsenders > > \ > while(\) { > > if ( m/^mess\s+/ ){ > > print OUT $_,"
"; > > next; > > } > > else { > > print "\
\n"; > > $_ =~ s/\s+/\\",$_,"\n"; > > } > > > > print "\
/g; > > print OUT "\
$_\
\n"; > > last; > > } > > } > > > > while ( \ ) { > > $_ =~ s/\ > $_ =~ s/>/>/; > > $_ =~ s/^\s*/\
/; > > $_ = s/\s+/\/; > > PRINT OUT "\
"; > > $escmode = 1; > > -] > > > > > > ######################## > > > > This page produces (by embpexec.pl): > > > > > >
> > > > Statystyki poczty - summary of senders > > > > > > > >
> > > > > > ############################ > > > > What is wrong with it? How can I debug this? > > > > Siaco. > > > > -- > > Ryszard ?ach > > Internet Designers s.c. > > http://www.id.pl > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org > > For additional commands, e-mail: embperl-help@perl.apache.org > > -- > __________________________________________________________ > Mr. Erich L. Markert emarkert@pace.edu > Computer Learning Center TEL (914)422-4328 > Pace University > 1 Martine Ave > White Plains, New York 10606-1932 > > Those who do not understand Unix are condemned to reinvent it, poorly. > -- Henry Spencer > > --------------------------------------------------------------------- > To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org > For additional commands, e-mail: embperl-help@perl.apache.org > -- Ryszard �ach Internet Designers s.c. http://www.id.pl