If you're running your tests under Test::Harness, it'll set $ENV{HARNESS_ACTIVE} for you. You can then write:
sub main { # everything you'd normally execute here } main() unless ($ENV{HARNESS_ACTIVE});
In reply to Re: Testing subroutines from a script
by chromatic
in thread Testing subroutines from a script
by mp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |