kk2202 has asked for the wisdom of the Perl Monks concerning the following question:
FileA has a subroutine "funcA" funcA invokes a subroutine "funcB" in another file "FileB".
Now inside funcB in FileB, there is an error due to which it exits from the there. (exit 1 had been used).
Now how do I know about this in funcA. Please note that I can not use "return" in funcB. That is a very big subroutine and changing exit to return -1 or so creates other issues.
Is there a way or any variable that I can check in funcA in FileA that might indicate me that funcB has exited with error.
FileA sub funcA{ funcB(); //how to check if funcB has returned due to "exit 1" } FileB sub funcB{ ........... ........... ........... if () exit 1; ........... ........... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Subroutine to indicate error condition
by moritz (Cardinal) on Oct 15, 2009 at 07:22 UTC | |
|
Re: Subroutine to indicate error condition
by Marshall (Canon) on Oct 15, 2009 at 08:35 UTC | |
|
Re: Subroutine to indicate error condition
by cdarke (Prior) on Oct 15, 2009 at 08:16 UTC |