in reply to use statement in a conditional?
Or you could use it in an eval, and run the else if it fails.if (<check that the file exists>) { require 'settings.pm'; settings->import(); } else { $::CONFIGPATH = "C:\\configdir\\config.pm"; }
eval "use settings"; if ($@) { $::CONFIGPATH = "C:\\configdir\\config.pm"; }
|
|---|