in reply to Testing a .pl script
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Test automation
by perl_help26 (Beadle) on Jul 01, 2015 at 14:46 UTC | |
by Eily (Monsignor) on Jul 01, 2015 at 15:01 UTC | |
by perl_help26 (Beadle) on Jul 01, 2015 at 15:05 UTC |