in reply to Testing parts of perl scripts
Best answer is the one you've excluded: put all your functionality into module(s), and then use standard perl testing (./Build test or make test, via tests in t/*.t files) to load and test them.
Next best would be to take your "main program" and put it into a function, say "do_main" so that all you're really doing is calling "do_main". And then it's trivial:
And then, in your test code, you can simply require "my-script.pl"; and you can call any function in there whatsoever.do_main unless (caller);
|
|---|