metaperl has asked for the wisdom of the Perl Monks concerning the following question:
use Data::Dumper; use strict; use warnings; sub risk_eval { { 'age_22' => 2, 'violations' => '1', 'age_18' => 2, 'dui' => '0', 'insured' => '1', 'major' => 0, 'tickets' => 0 }; } sub _build_risk_type { my($self)=@_; my $E = risk_eval ; my %E = %$E; warn ('risk criteria - ' . Data::Dumper::Dumper(\%E) ) ; $E{age22} && $E{insured} && !$E{sr22} && !$E{dui} && ($E{tickets} +<= 1) && !$E{major} and return 'prem' ; $E{age18} && $E{insured} && !$E{sr22} && !$E{dui} && $E{tickets} < += 3 and return 'std' ; $E{age18} and return 'substd'; die 'No useable risk type found.' } _build_risk_type;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: boolean chaining - && and 'and'
by si_lence (Deacon) on Jul 29, 2009 at 14:39 UTC | |
|
Re: boolean chaining - && and 'and'
by kyle (Abbot) on Jul 29, 2009 at 14:40 UTC | |
|
Re: boolean chaining - && and 'and'
by ikegami (Patriarch) on Jul 29, 2009 at 14:41 UTC | |
by moritz (Cardinal) on Jul 29, 2009 at 14:52 UTC | |
|
Re: boolean chaining - && and 'and'
by GrandFather (Saint) on Jul 29, 2009 at 21:04 UTC |