The easiest approach is to break it into a separate module; it's really not that difficult.
Alternately, if the invocation is pretty simple, you can wrap everything in main() and call that only if you have no caller.
main() unless caller(); sub main { my $q = CGI->new(); # .... }
Then do or require the script and test it as normal.
In reply to Re: How do I test a cgi script's subroutines?
by chromatic
in thread How do I test a cgi script's subroutines?
by hesco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |