You can do something like this:
This way the main sub will be called only if the script is called directly and not if it is included in a test through require "script.pl".sub main { until (should_stop()) { # code goes here } } main unless caller;
In reply to Re: Test automation
by Eily
in thread Testing a .pl script
by perl_help26
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |