The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Lots of people have pointed out BEGIN, "use if" and "require".
Another point is that (unless your program is very simple) you probably don't want to include the Tk interface and the command line interface in the same packages. Instead do something like this:
The two MyInterface subclasses provide different ways of doing the same thing... so then you can write:
This separates your interface code nice and cleanly from the rest of your program. Of course, you still have to be careful what you require, because if Tk isn't installed, then MyInterface::Tk will presumably die on compilation. dave hj~ In reply to Re: using 'use' conditionally
by dash2
|
|