more useful options | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hello xorl, You can make this kind of code cleaner by taking an OO approach. Create an abstract class Module with the common interface, and subclass it as Module::SuperCool, Module::AlmostCool, and Module::Uncool. Then create a Module object once:
and use it as needed — there will be no need for switch statements using a $supercool flag. Of course, Module::SuperCool will be implemented using super cool functions provided by cutting-edge CPAN modules; Module::AlmostCool will be implemented using less cool functions from older CPAN modules; and Module::Uncool will be implemented using your 10,000 lines of code. Hope that helps,
In reply to Re: The "right" way to make your script run with old versions of perl
by Athanasius
|
|