bulrush has asked for the wisdom of the Perl Monks concerning the following question:
@z=`perl child.pl -option1 -option2`The whole command line for child.pl is in a scalar variable but that shouldn't matter. So I noticed that @z in parent.pl would return completely blank after I made some changes to child.pl. Lo and behold I had compile or syntax errors in child.pl, so none of my other error messages (written to STDOUT with "print") would be written from child.pl.
So when I'm running parent.pl, how do I capture compile errors when calling child.pl? Do I have to do something like
@z=`perl -c child.pl`;before I do anything else? Will @z return STDERR messages or just STDOUT? If I did
@z=`perl child.pl -option1 -option2` or die "Possible compile errors in child.pl";Would that do what I want?
Thank you. Looking for some input so I can learn more about this.
|
|---|