
Thierry
Deleted
Mar 9, 2000, 9:01 AM
Post #1 of 3
(652 views)
|
|
(offline mode: enter name=value pairs on standard input)
|
Can't Post
|
|
This is the CronMessage (to my mail) I get once I let that script run through Cron. (offline mode: enter name=value pairs on standard input) The script : #!/usr/bin/perl use English; use CGI; use integer; require LWP::UserAgent; $q = new CGI; #print $q->header; $mytest =$q->param(mytest); $ssi = "no"; $ua = new LWP::UserAgent; $the_cgi = CGI->new; $domain = "www.wort.lu/w_aktu/default.htm"; #$domain = $ENV{'QUERY_STRING'}; # ex. "script.cgi?yahoo.com"; $begin = "http://"; $data = $begin . $domain; $breakupa = "<A HREF=\"/w_ak"; # If this string is in a line, that line will be printed. $breakupb = "</A>"; # If this string is in a line, that line will be printed. $breakupc = "<IMG BORDER=0"; # If this string is in a line, that line will be printed. $replacea = "<A HREF=\"/w_aktu/"; $replaceb = "<font face=\"Arial, Helvetica, sans-serif\" size=\"1\"><A HREF=\"http://www.wort.lu/w_aktu/"; $replacec = "</A>"; $replaced = "</A><BR>"; $replacee = "<BR></A><BR>"; $replacef = "</A>"; $numheads = "900"; # Number of headlines you want to be printed Times Three! $footer = ""; $lookup = new HTTP::Request 'GET', "$data"; $response = $ua->request($lookup); @lines = split (/\n/, $response->content); $logpath = "../../wort2.txt"; open (LOG, ">$logpath"); $i = 0; foreach $line (@lines) { if ($line =~ /$breakupc/ && $i < $numheads) { $i += 1; } elsif ($line =~ /$breakupa/ && $i < $numheads) { $line =~ s/$replacea/$replaceb/; print LOG "$line"; $i += 1; } elsif ($line =~ /$breakupb/ && $i < $numheads) { $line =~ s/$replacec/$replaced/; $line =~ s/$replacee/$replacef/; print LOG "$line"; $i += 1; } } exit; close(LOG); ......... It parses through html then writes to an File. If I run it manually (from my browser) it does work, but from cron it just generates that error message. Then I entered this line in the crontab */2 * * * * perl /home/waatleef/public_html/cgi-bin/newsg/wortcron.pl name=value So this should run wortcron.pl every 2 minutes, but it does not _not_. If I go into the dir /home/waatleef/public_html/cgi-bin/newsg/ and run "perl wortcron.pl name=value" ; everything runs fine (file is written, no error message) Anybody knows a way arround it
|