I see that as a plus, since it probably doesn't make sense to import from something which is conditionally imported. However, it's not hard to import if so desired.
BEGIN { eval { require Cache::File } or warn("Proceeding without Cache::File\n"); Cache::File->import(qw( ... )) if Cache::File->can("import"); }
or
BEGIN { my @imports = qw( ... ); eval "use Cache::File \@imports" or warn("Proceeding without Cache::File\n"); }
The BEGIN ensures prototypes are properly loaded.
In reply to Re^3: stronger than eval?
by ikegami
in thread stronger than eval?
by andyford
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |