wusphere has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I would like to know, how could I evaluate the status of a subroutine. See the subroutine below. If it fails, I would like to capture the status and process something else. All your help is appreciated.
Thankssub verifyRecCount ($,$,$) { my ($recCount) = @_[0]; my ($tlrRecordCount) = @_[1]; my ($verRecordCount) = @_[2]; if ($recCount == $tlrRecordCount) { slog($logfile,"Comparing Record Count: $recCount to $tlrRe +cordCount. (OK!)"); $verRecordCount = 1; } else { slog($logfile,"Comparing Record Count: $recCount to $tlrRe +cordCount. (FAILED!)"); exit 6; } return $verRecordCount; }# verifyRecCount()
20040816 Janitored by Corion: Fixed code tag, added formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Evaluate success or failure of a subroutine
by japhy (Canon) on Aug 16, 2004 at 13:46 UTC | |
|
Re: Evaluate success or failure of a subroutine
by Zaxo (Archbishop) on Aug 16, 2004 at 13:49 UTC | |
|
Re: Evaluate success or failure of a subroutine
by Joost (Canon) on Aug 16, 2004 at 13:49 UTC | |
|
Re: Evaluate success or failure of a subroutine
by naChoZ (Curate) on Aug 16, 2004 at 15:19 UTC | |
by ikegami (Patriarch) on Aug 16, 2004 at 15:51 UTC |