willson1 has asked for the wisdom of the Perl Monks concerning the following question:

hi, ive finished a couple of scripts off with a bit of help from a couple guys on here an it all works locally, but when i put it online, it runs for a bit then stops, i get this error:

[an error occurred while processing this directive]

then the file stops processing, also ive tried using cron, this didnt work either and also using shell (puTTY to be exact) with no progress.

there are 3 scripts, each one runs after its predecessor has finished and is designed to run in a indefinite loop

anyone have any ideas? any help received is welcome and i would be very grateful.

thanks

UPDATE: code can be found here: http://pastebin.com/XJbGHjjw
  • Comment on my scrip works locally when testing but not online

Replies are listed 'Best First'.
Re: my scrip works locally when testing but not online
by davido (Cardinal) on Mar 14, 2012 at 17:53 UTC

    That's an Apache error message related to Server Side Includes. See the following: http://httpd.apache.org/docs/2.0/howto/ssi.html#config.

    One key to solving problems is understanding the error messages. Knowing where the error messages are coming from is the first step in that regard. I happen to know Perl won't ever create that message. If we rule out Perl that leaves dependencies, and in this case the dependency happens to be Apache. To be quite honest, I wouldn't have known that it's an Apache message except for typing '"an error occurred while processing this directive"' into my Google search box and reading a few of the links.


    Dave

Re: my scrip works locally when testing but not online
by zentara (Cardinal) on Mar 14, 2012 at 17:24 UTC
    Check your http error log for the error, and/or put
    use CGI::Carp qw/fatalsToBrowser warningsToBrowser/;
    in your code, but remove it after the error is resolved.

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh
Re: my scrip works locally when testing but not online
by tobyink (Canon) on Mar 14, 2012 at 17:31 UTC

    Are these scripts running as CGI processes through a browser, or running at the command line? They're each quite different environments to deal with. In the former you need to deal with things like HTTP timeouts.

    I have seen the exact words of your error message crop up in Apache SSI contexts. If your scripts are running as CGI, make sure that Apache isn't trying to post-process them as SSI.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
      command line locally but neither work really online
Re: my scrip works locally when testing but not online
by muppetjones (Novice) on Mar 14, 2012 at 17:18 UTC

    A couple of thoughts
    1) make sure it's the same version of Perl
    2) make sure you have the same libraries online
    3) add 'use diagnostics;' to the top of your file -- it should give you more detailed error info
    4) try using Carp ('use Carp;') for more useful error messages

    Also, it would be helpful if you could post the script

Re: my scrip works locally when testing but not online
by mendeepak (Scribe) on Mar 15, 2012 at 06:10 UTC