Its a case of if certain facilities are available, then I would like to use them and if not then I will get by without. Sometimes there is more than one module available to do something and I want my code to work with either and not fall over if my particular favourite is missing. The above works fine if I can use require, but not all modules will work with a simple require. What is the recomended way to code this and still be able to utilise a "use" statement?my $souperdouper=0; eval { require "SuperDouperPrinter" } and $superdouper=1; if ($souperdouper) { SouperDouperPrinter::Print($something); } else { print $something; }
In reply to How can I catch a failure of use? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |