|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
#!/usr/bin/perl -w
use CGI; print "Content-Type: text/htmlnn"; system "ls > temp"; -------------------------------------------- It's sucessful in text mode But it doesn't create "temp" when use browser. |
|
#2
|
|||
|
|||
|
>>#!/usr/bin/perl -w
>>use CGI; >>print "Content-Type: text/htmlnn"; >>system "ls > temp"; ############################################ Why not use the most common way in Perl.. #!/usr/local/bin/perl open(NEW, "> temp"); print "Content-Type: text/htmlnn"; Or use UNIX 'touch' command to create new file? #!/usr/local/bin/perl system("touch temp"); print "Content-Type: text/htmlnn"; ############################################ Or use the backtick operator: #!/usr/local/bin/perl @ls = `ls temp`; print "Content-Type: text/htmlnn"; print "@ls"; [This message has been edited by freebsd (edited May 19, 2000).] |
|
#3
|
|||
|
|||
|
Ya,
Because I need to run system command use perl ------------------------------------- [/home/httpd/cgi-bin/ppp] #!/bin/sh cd /home/httpd/html/webalizer; webalizer -Q /var/log/httpd/access_log; ------------------------------------- [/home/httpd/cgi-bin/do_webalizer.pl] #!/usr/bin/perl -w use CGI; print "Content-Type: text/htmlnn"; system "sh ppp"; $url="http://abc.com/webalizer/"; print "Location: $urlnn"; ------------------------------------- when we run http://abc.com/cgi-bin/do_webalizer.pl It doesn't work for system and location. |
|
#4
|
|||
|
|||
|
Why not just use ONE perl script like this?
############################################ [/home/httpd/cgi-bin/do_webalizer.pl] #!/usr/local/bin/perl `/home/httpd/html/webalizer/webalizer -Q /var/log/httpd/access_log`; print "Location: <A HREF="http://abc.com/webalizer/nn";" TARGET=_blank>http://abc.com/webalizer/nn";</A> [This message has been edited by freebsd (edited May 19, 2000).] |
|
#5
|
|||
|
|||
|
A error message:
HTTP/1.1 200 OK Date: Fri, 19 May 2000 04:48:19 GMT Server: Apache/1.3.12 (Unix) PHP/4.0RC2 mod_layout/1.6 Keep-Alive: timeout=15, max=99 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 200 OK |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Who knows what's wrong |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|