Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Crontab error!

by davorg (Chancellor)
on Apr 04, 2001 at 14:21 UTC ( #69606=note: print w/replies, xml ) Need Help??


in reply to Crontab error!

Somewhere in your code you have a subroutine called main::head. It is defined as taking one argument (a scalar). Later on, it's being called without any arguments. I could give more details if I could see the code.

--
<http://www.dave.org.uk>

"Perl makes the fun jobs fun
and the boring jobs bearable" - me

Replies are listed 'Best First'.
Re: Re: Crontab error!
by Ozoz (Initiate) on Apr 04, 2001 at 14:30 UTC
    Here's the script. Thx! :)
    #!/usr/bin/perl # Environment Variables use LWP::Simple; use CGI qw/:standard :netscape :html3/; $sonuc="/home/usr254/html/sa/filmler/HeadLine.tlt"; &toplasa1; exit; sub toplasa1 { $elle1= get("http://www.ntvmsnbc.com/news/FILM_front.asp"); # Oncesini sil $elle1=~ s/^.*<!---Insert_Tertiary_Stories--->//s; # Sonrasini sil $elle1=~ s/<!---END Insert_Tertiary_Stories--->.*$//s; # Gereksiz bosluklari kaldir $elle1=~ s/\s\s//g; # Enterlari kaldir $elle1=~ s/\n//g; # Returnleri tanimla $elle1=~ s/<TD WIDTH=13 VALIGN="TOP">/\n/g; $elle1=~ s/<!---spacing between headlines--->/\n\n/g; $elle1=~ s/&#0145;/'/g; $elle1=~ s/&#0146;/'/g; $elle1=~ s/&#0147;/"/g; $elle1=~ s/&#0148;/"/g; # Butun tablari kaldir $elle1=~ s/<[^>]+>//g; # Baaas open(PAGE,">$sonuc") || die("Error $! opening file"); print PAGE $elle1; close(PAGE); }

      Both LWP::Simple and CGI try to export a function called head and they have different prototypes. This can lead to badness - as you've seen.

      However, you don't actually use either of these subroutines, so you just need to stop importing them (or, at least, one of them). Quickest fix is to change the use LWP::Simple line to:

      use LWP::Simple 'get';
      --
      <http://www.dave.org.uk>

      "Perl makes the fun jobs fun
      and the boring jobs bearable" - me

        Or change   use CGI qw/:standard :netscape :html3/; to   #use CGI qw/:standard :netscape :html3/; or remove that line entirely, since the script doesn't really use anything from CGI.pm

        Thanks Dave! Though I still receieve an email, it's empty; just informing that the cronjob is done I think. No errors. thx :)
        500 error.log for the script:
        /home/usr254/html/sa/Global symbol "$sonuc" requires explicit package +name at ok-filmler.cgi line 8. Global symbol "$elle1" requires explicit package name at ok-filmler.cg +i line 15.
Re: Re: Crontab error!
by Ozoz (Initiate) on Apr 04, 2001 at 14:38 UTC
    This is the crontab that runs the scipt above:
    3 1 * * * /home/usr254/cgi-bin/graab/ok-filmler.cgi

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://69606]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2023-03-20 09:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (59 votes). Check out past polls.

    Notices?