Putting aside the argument that most logic should be
in libraries and not scripts, what is the best
practice for writing test cases to verify that your
Perl scripts compile?  My quick and dirty solution is
something like:

 use Test::More tests => 1;
 chomp (my $output = `perl -c $script 2>&1`);
 is($output, "$script syntax OK", "$script compiles");

I'm sure I could clean this up by opening a pipe
instead of using backticks and output redirection. 
But even that doesn't smell very good.  I've looked
around on CPAN, but I have not yet found a Test::
module that seems appropriate.  I also wondered if
fiddling with $^C would do the trick somehow.  Any
suggestions?  Thanks.  

-Jeff  


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to