#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    79
    Rep Power
    15
    #!/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. #2
  3. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>#!/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).]
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    79
    Rep Power
    15
    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.
  6. #4
  7. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    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).]
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    79
    Rep Power
    15
    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

IMN logo majestic logo threadwatch logo seochat tools logo