There are some details that would help make it easier to answer your questions. 1) What is the form of the output from your subprograms? (ie, Do they print to STDOUT or STDERR, or do they just return a value?). 2) How are you calling the subprograms from your main program? (ie, as direct function/method calls, or by system() calls or qx// or ``).
Because if your subprograms are just printing to STDOUT, and you are calling them from your main program via function/method calls, it surprises me that you cannot see their output. But if you are calling a separate process (which your use of "program" rather than "function" or "method" might indicate) using a system() call, then you are going to have to switch to a print `subprogram` paradigm, otherwise the separate process's output will be lost to the system()'s ether.
Update: Specifically, if your mainprogram.pl looks like:
#!perl
use warnings;
use strict;
use MyModuleToBeTested;
callSomeFunctionThatPrintsToSTDOUT();
... then i don't see why it wouldn't print.
OTOH, #!perl
use warnings;
use strict;
system("callSomeProgram");print `runASecondProgram`;
... will not print anything from "callSomeProgram", because system() doesn't output, whereas it will print the STDOUT from "runASecondProgram" because of your print statement.
edit: strikeout patently false info and fix typos from the fix. Thanks choroba |