in reply to Dealing with errors in subroutines
For example you could do something along these lines:
for (@users) { my $success = eval { add_account($_); }; warn "Can't add user '$_': $@" unless $success; }
This has the advantage over a plain return() that throwing the exception works the same if you call subs from add_account() and they detect an error.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Dealing with errors in subroutines
by Bloodnok (Vicar) on Sep 09, 2009 at 12:17 UTC | |
|
Re^2: Dealing with errors in subroutines
by Boldra (Curate) on Sep 14, 2009 at 07:57 UTC | |
by moritz (Cardinal) on Sep 14, 2009 at 10:48 UTC |