in reply to How do I test a cgi script's subroutines?
I talk about this at length in How a script becomes a module, which is workign it's way into a chapter in Mastering Perl. chromatic gives you the secret, but I show a full example of using it.
If you don't like the caller idea, you might just break out the subroutines into their own file and load that file with require. You don't need to write a full module: you're just pulling in code that used to be there but is now stored in a separate file. Once in the separate file, you can easily test the individual subroutines without executing any code until you want to.
Good luck :)
|
|---|