Nope, qx este cat se poate de rezonabil... Incerca un:
---------------cut here------------------
#!/usr/bin/perl -w
use strict;
$| = 1;
print "Content-Type: text/html\n\n";
my $cat_output = qx{cat /cale/catre/fisier/care/nu/exista};
print $cat_output;
exit(0);
__END__
---------------cut here------------------
Cand scriptul va rula, pagina in browser va fi goala, si ca nu o sa ai
parte decat de un warning de genul "cat: file not found" in log-uril lui
Apache sau ce-o fi...
> Chiar daca prima linie scrie "Content-type ...", daca rulezi ceva
care da
> eroare (system, qx!) poate sa apara pe output inaintea lui
Content-type si
> atunci da eroare. E nevoie sa fie dat un flush ca sa nu mai se
intample
> asta (printf-ul face buffer).
> Merita rulat scriptul manual, eventual cu "su - nobody
/cale/script.cgi".
> Poate nu are in path ceva sau nu are drepturi pe ceva.
>
>
>
> On Wed, 13 Jun 2001, Bogdan Marinca wrote:
>
> >
> >
> >
> > On Wed, 13 Jun 2001, Mircea S. wrote:
> >
> > >
> > > Nu e obligatoriu 'exit(0);' ... Eroare asta "Premature end of
script
> > > headers" apare atunci cand ceva nu e bine in script...
> >
> > sau e posibil sa faca exit sau sa crape inainte de a apuca sa scrie
ceva
> > la output (headerele, etc)
> >
> > ---
> > Send e-mail to '[EMAIL PROTECTED]' with 'unsubscribe rlug' to
> > unsubscribe from this list.
> >
> >
>
> --
> Cele bune. +------ Mihai
Voicu ------+
> | RDS network
engineer |
> |
http://mihvoi.rdsnet.ro |
> ----------------------------------------------------------------------
----
> Privileged/Confidential Information may be contained in this message.
If
> you are not the addressee indicated in this message (or responsible
for
> delivery of the message to such person), you may not copy or deliver
this
> message to anyone. In such a case, you should destroy this message and
> kindly notify the sender by reply e-mail.
>
> ---
> Send e-mail to '[EMAIL PROTECTED]' with 'unsubscribe rlug' to
> unsubscribe from this list.
>
---
Send e-mail to '[EMAIL PROTECTED]' with 'unsubscribe rlug' to
unsubscribe from this list.