Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 18th, 2000, 11:24 PM
rtna rtna is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 79 rtna User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
#!/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.

Reply With Quote
  #2  
Old May 19th, 2000, 05:45 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
>>#!/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).]

Reply With Quote
  #3  
Old May 19th, 2000, 07:57 AM
rtna rtna is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 79 rtna User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
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.

Reply With Quote
  #4  
Old May 19th, 2000, 08:48 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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).]

Reply With Quote
  #5  
Old May 19th, 2000, 09:54 AM
rtna rtna is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 79 rtna User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Who knows what's wrong

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap