Re: (hajimu.takahashisb06@unisys.co.jp) - webserver does not give
am 26.12.2006 09:44:03 von Karl.Moens
> I write the next script and test successfully by the client PERL.
> Afterwards I try this script on the web server. But, it results in ; 1.
> system("commnd ..) makes no output in the IE.
> 2. system("perl -v >..) makes no file output on the web server.
>
> #!/usr/local/bin/perl
> print "Content-type: text/html\n\n
"; system("command /c dir");
> system("perl -v > c:\\inetpub\\wwwroot\\pc_sale\\cgi-bin\\log");
> print "END";
> exit(1);
>
> PLS advise me the correct way!
Although there are surely thousands of better ways to achieve what you are
trying to do here, the main problem you have here is that the output of the
system command is not being output on the "channel" which the webserver
serves to the client.
You will have to capture this output by using the "backtick" command and
put this output in a variable which you can then print:
my $captured_output = `command /c dir`; print "$captured_output\n";
If that doesn't work then probably there is something wrong with the set-up
of your web-server.
As far as your second problem goes: is your web-script authorized to output
to this file?
Best regards,
Karl Moens
aka CountZero on Perlmonks.org
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
This message and any attachments are confidential. If you have received
this message in error please delete it from your system. If you require any
assistance please notify the sender. Thank You.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs