Perl Monk, Perl Meditation | |
PerlMonks |
Re^2: Converting words to numbers with HOP::Parserby Ovid (Cardinal) |
on Nov 06, 2005 at 19:55 UTC ( [id://506147]=note: print w/replies, xml ) | Need Help?? |
I missed that module when I was searching for it on the CPAN. Bummer. I find it interesting what extremely different styles our solutions have. Your's is quite procedural. Using a parser is declarative. What I find interesting about the latter is how one can pretty much rearrange all of the declarative portions of the parser and things still work as intended. This gives one a lot of flexibility. It's also (relatively) easy to extend. If I want to turn it into a calculator which responds appropriately to "divide three by seven and add twelve point two", I can do that. Further, it would merely build on what's there and nothing else would need to be touched. I wonder how feasible this is with a procedural model. In any event, your speculation was correct. My post was primarily intended to show off the power of the HOP::Parser as opposed to "hey, let's turn words into numbers!" Cheers, New address of my CGI Course.
In Section
Cool Uses for Perl
|
|