Decision::ParseTreeDecision::ParseTree is a Perl module for replacing waterfall IF-ELSIF-ELSE blocks. | |
Download |
Decision::ParseTree Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Ben Hengst
- Publisher web site:
- http://search.cpan.org/~notbenh/
Decision::ParseTree Tags
Decision::ParseTree Description
Decision::ParseTree is a Perl module for replacing waterfall IF-ELSIF-ELSE blocks. SYNOPSISDeath to long if-elsif-else blocks that are hard to maintain, and hard to explain to your manager. Heres an overly simplistic example:OLD CODE if ( $obj->is_numeric ) { if ( $obj->is_positive ) { print 'Positive Number'; } elsif ( $obj->is_negative ) print 'Negative Number'; } else { print 'Looks like zero'; } else { print 'Non-Numeric Value'; }NEW CODEYAML Decision Tree --- - is_num : 0 : Non-Numeric Value 1 : - is_pos : 1 : Positive Number - is_neg : = : Looks like zero 1 : Negative Number ... Requirements: · Perl
Decision::ParseTree Related Software