in reply to Modules vs. Libraries
Either way, this answer appears in the Perl Cookbook from O'Reilly (co-author gnat is a PerlMonk!)
The basic answer is to use an eval block around your require and use statements. Thus you can have the module names in a string, and you can trap errors if there is a problem (such as the module being for the wrong OS).
You can use the perl variable $^O to learn what system you are on, and the perl function perlfunc:readdir to get the filenames to try to load.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Modules vs. Libraries
by Intrepid (Curate) on Jun 28, 2000 at 21:25 UTC | |
by takshaka (Friar) on Jun 28, 2000 at 21:43 UTC | |
by Intrepid (Curate) on Jun 28, 2000 at 22:15 UTC |