Hi folks.
I'm moving on with my Trainset project and I've got to the point where I want to develop Trainset::Tk to create a user interface for someone setting in a signalbox.
To do this, I've created Trainset/Tk.pm as below, and included a
use Trainset::Tk;
in my Trainet.pm. The problem I have is that on some of my development boxes I don't have Tk installed. This then prevents me from running the program even though I'm not actually wanting to *use* the Tk modules (most of my work is developing the logic engine in text mode).
Is there a way to only 'use Trainset::Tk' conditionally, or even better, have it auto-detect the availability and simply ignore it if it's not there.
I have this in a module that I'm currently working on:
$HAS_YAML = eval { require YAML; 1; };
Then I just test the variable to see if the feature is available.
Regards, Randy.
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>