The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
While nested if statements look a mess, the unfortunate truth is that this is really the way decisions are made by humans.
If my car starts, I'll go to work, If net nets up, I'll check email and read PM, If there's a good thread, I'll read it, etc. . . . .. The problem with a one-dimensional dispatch table, is that the operations in the outermost nests need to be replicated into much of the table entries, which require programatically building complicated hashes, futhur sacraficing readability. I'm not sure how to build a "multi-dimensional" dispatch table where say the "rows" have one set of functions and the "columns" have another, without programatically building the subroutines. say $daysactions{$morning_situation}{$afternoon_situation}=\&listofstufftodotodaygivenmorningandafternoonsituations; Any ideas? drinkd In reply to Defense of nested ifs
by drinkd
|
|