in reply to Selective module loading
my @modules = qw(Tk Gtk); my $loaded = 0; foreach my $module (@modules) { eval { require $module; import $module; }; next if $@; $loaded = 1; last; } die "Can't load anything (@modules)\n" unless $loaded; require POE; import POE;
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Selective module loading
by Azhrarn (Friar) on Jul 15, 2003 at 17:43 UTC |