Title: RE: A newish follow-up question about passing control

The other option would be to modify your system command to redirect all stdout and stderr to "nul" by adding a "> nul" and "2>nul" at the end of your command. The problem here is really that web servers capture all STDOUT and STDERR and print it to the CGI object. If you can ensure there is no output then this will not occur.

Non-the-less, I would go with Peter's recommendation and find a perly solution that is portable.

Trevor.

-----Original Message-----
From: Peter Guzis [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:06 PM
To: [EMAIL PROTECTED]
Subject: RE: A newish follow-up question about passing control


Your script is printing out the output from the system call before you have
a chance to send proper HTTP headers.  Your best option is to use File::Copy
instead of relying on non-portable system commands like copy. 

---

use File::Copy;

copy ('path1/file', 'path2/file');


Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
email: [EMAIL PROTECTED]
www.encad.com

-----Original Message-----
From: Andrew Wax [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 9:50 AM
To: [EMAIL PROTECTED]
Subject: A newish follow-up question about passing control


Good Afternoon -

I included a piece of code that was previously given to me - it works file
if I leave the system command commented - if I let the system command
execute (remove the #) then I get an error message that :

malformed header from script. Bad header=        1 file(s) copied.:
c:/program files/apache group/apache/cgi-bin/basic.pl
 which is kind of understandable because it is taking the output from the
copy command and feeding it into the next part.

Any ideas how to get rid of this problem?

Thanks in advance (I know someone might have touched upon this - but it did
not sink in)

Andrew


#!c:/perl/bin/perl

use strict;
#system("copy c:\\garbage\\ta\\fe.pl c:\\garbage\\ta\\fe.bat");
use CGI;
my $q = CGI->new();
print $q->redirect('http://waxwaxwax.com/sg-reportmenu.htm');
exit;



_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to