there are places to use dispatch tables, closures, or even self modifying code in rare instances. but sometimes doing these things can cloud further development of code, which should just be written in a clearer modular fashion. Case in point deciding sub names depending on input filename, is probably not the best of things to do. it's implying semantics due to a particular filename. should (i think) be explicit instead, e.g. via parameter -filetype or similar explicit contraption
the hardest line to type correctly is: stty erase ^H