On Sat, 29 Apr 2000 13:34:34, "Jack Dunnigan" <[EMAIL PROTECTED]>
wrote:
>But I know of no way to include a 'use' statement under a conditional statement.
You have to put the conditional in a begin block, like this:
BEGIN {
if ($condition) {
require Module;
local $@;
eval { Module->import() };
# or if you want to import only specific names:
# eval { Module->import(qw(NAME1 NAME2 $VAR1 $VAR2)) };
}
}
The eval is necessary because the absence of an import() method should not
be an error (at least the implementation of "use" things so).
-Jan
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]