in reply to Being more Assert-ive with Perl
is better written as# warn the user of the wrong input and return # false, leaving the calling routine dealing # with things (defined($coin) && $coin == 25) || (warn("You must insert 25 cents"), +return 0);
IMHO, that would even be more readable# warn the user of the wrong input and return # false, leaving the calling routine dealing # with things (defined($coin) && $coin == 25) || return do {warn("You must insert 25 + cents"); 0};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Being more Assert-ive with Perl
by stvn (Monsignor) on Sep 23, 2004 at 16:00 UTC |