in reply to How to distinguish a crontab call and a web call

You can make two separate scripts, one called by the crontab and one called by the CGI, let's say `cli.pl` and `index.pl`. They can call a common `do-my-work.pm` script with the business logic.

This will help you to separate the input params and the presentation in the calling scripts and the domain in the separate module. You can have the complete HTML or json output for the web call only in `index.pl`.

  • Comment on Re: How to distinguish a crontab call and a web call