Hi,
I am a newbie, have to fix an issue in existing perl scripts.Kindly assist me with the following.
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;
...........
...........
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.