nmerriweather has asked for the wisdom of the Perl Monks concerning the following question:
&code_to_create_new, however, is not a subroutine - its a block of code. i'd like to try and figure out a way to handle the statement as such:if ( $action eq 'new' ) { if (!$name) { &print_error; } else { &code_to_create_new(); } }
where ###?### is some perl command that i do not know, that would behave like 'return' does, but affects the parent of the if statementif ( $action eq 'new' ) { if (!$name) { &print_error; ###?### } &code_to_create_new(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: need advice on conditionals
by thedoe (Monk) on Feb 27, 2005 at 21:01 UTC | |
|
Re: need advice on conditionals
by chromatic (Archbishop) on Feb 27, 2005 at 21:28 UTC | |
|
Re: need advice on conditionals
by trammell (Priest) on Feb 28, 2005 at 00:10 UTC | |
|
Re: need advice on conditionals
by Fendaria (Beadle) on Feb 27, 2005 at 21:41 UTC | |
|
Re: need advice on conditionals
by chas (Priest) on Feb 27, 2005 at 21:09 UTC |