#start the test case. my $x= new blahblah; # what I'm testing. # The above and following method calls will be different for each test. $x->foo (5000); $x->bar(200); # output_test is my common code I'll use i'll use to validate all the similar tests. my $ot= output_test->new ("out1"); # ready... different name for each. my $outfile= $ot->openout(); # get set... (common code to generate file name, open it for output, check for errors) $x->emit ($outfile); # this method call will differ for each test case, so it's not part of the common code. $ot->ok_files_match(); # and back to the common code again to compare the resulting file with a reference "correct" file. # do all that again, with differences. # ...