On Tue, 04 Oct 2005 05:45:13 -0400, Tom Allison wrote: > It seems that there really isn't any clear way to test a subroutine > within a script and not a module. Besides loading it into a module and > running everything from there -- any suggestions? I don't see it > practical putting a function into a module when the function will only > ever be used in that one script.
Really? I do it all the time. Mainly to facilitate testing. The alternative would be something way too fancy that read the script and extracted the subroutines. Alternatively, you could do something like set an environment variable in your test wrapper, 'do' the script, and have the script only execute its main block if the environment variable isn't set... sounds way too ugly though. I usually put the module in the same directory or one nearby that I can locate with FindBin in the main program. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>