smturner1 has asked for the wisdom of the Perl Monks concerning the following question:
Two questions here; one, is it appropriate to place error handling in a subroutine; two, where am I going wrong in the last two 'elsif' statements in this thread?
sub errhand { if ($website eq "three"){ next; } elsif ($website eq "five"){ next; } elsif ($website eq "calnet-test"){ next; } #elsif ($old_ip eq /\d\d.\d\d.\d\d\d){ #next; #} #elsif ($new_ip eq /\d\d.\d\d.\d\d\d){ #next; #} else{ die, "ERROR - Format is 'deploy website old_ip new_ip || 'depl +oy [three; five;calnet-test] 21.01.001 22.02.002'" } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is it appropriate to handle errors through a subroutine?
by roboticus (Chancellor) on Jan 02, 2014 at 04:27 UTC | |
|
Re: Is it appropriate to handle errors through a subroutine?
by kcott (Archbishop) on Jan 02, 2014 at 05:39 UTC | |
|
Re: Is it appropriate to handle errors through a subroutine?
by Anonymous Monk on Jan 02, 2014 at 15:17 UTC |