in reply to Being more Assert-ive with Perl

Minor nitpick:

(defined($coin) && $coin == 25) || warn("You must insert 25 cents"), return 0;

Should be either

(defined($coin) && $coin == 25) or warn("You must insert 25 cents"), return 0;

or

(defined($coin) && $coin == 25) || (warn("You must insert 25 cents"), return 0);

Otherwise it will always return. I personally always use or for these kinds of idioms, as it is more likely to have the precedence I want.

Replies are listed 'Best First'.
Re^2: Being more Assert-ive with Perl
by stvn (Monsignor) on Sep 17, 2004 at 15:12 UTC

    Many thanks, I update the OP too.

    -stvn