in reply to boolean chaining - && and 'and'
$E{age22} isn't true.
When staring at it doesn't help, you can construct something like this:
print( $E{age22} ?1:0,"\n"); print( $E{insured} ?1:0,"\n"); print( !$E{sr22} ?1:0,"\n"); print( !$E{dui} ?1:0,"\n"); print( ($E{tickets} <= 1) ?1:0,"\n"); print( !$E{major} ?1:0,"\n");
Make sure to copy the expressions exactly. Don't retype them.
Update: I forgot to mention.
my $E = risk_eval; my %E = %$E;
can be written as
my %E = %{ risk_eval() };
but most people would just work with the reference instead of copying the hash.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: boolean chaining - && and 'and'
by moritz (Cardinal) on Jul 29, 2009 at 14:52 UTC |