steph_bow has asked for the wisdom of the Perl Monks concerning the following question:
UPDATE3 : SORRY, I HAVE JUST REALISED THAT THE FILES EXIST, EXCEPT THEY ARE IN SOME CHILD DIRECTORIES. SO THERE IS NO PROBLEM ANY MORE.
Hello Deak Monks
I would like to get the errors which concern a certain script (here prog2.pl) in my program, which is composed of several scripts, like:
my $cmd1 = "perl prog1.pl"; system($cmd1); my $cmd2 = "perl prog2.pl"; system($cmd2); my $cmd3 = "perl prog3.pl"; system($cmd3);
So for the script concerned (prog2.pl for example) , I write:
BEGIN { open(STDERR, ">stderr2.log") or die "Failed to open log file"; }
Then I write
close STDERR;
So that each time I invoke my script, it write only the errors for this part. However at the end, I have nothing. Could you explain ? Thanks
update: I erased the term subscript, as it was too ambiguous. update2 : just as cdarke said, what I called "subscript" meant another script being called as a child process. Sorry for the ambiguity. UPDATE3 : SORRY, I HAVE JUST REALISED THAT THE FILES EXIST, EXCEPT THEY ARE IN SOME CHILD DIRECTORIES. SO THERE IS NO PROBLEM ANY MORE.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: get the errors only for a part of the program
by cdarke (Prior) on Apr 09, 2008 at 13:30 UTC | |
|
Re: get the errors only for a part of the program
by apl (Monsignor) on Apr 09, 2008 at 13:29 UTC | |
|
Re: get the errors only for a part of the program
by Anonymous Monk on Apr 09, 2008 at 13:21 UTC |