The eval with braces will trap the die if Time::Hires is not on your system.if ( eval { require Time::Hires } ) { # The require was successful } else { # It was unsuccessful }
Cheers,
Ovid
Update: Whups! Since I hadn't used Time::Hires before, I wasn't aware of what it does internally. I suspect that autark's correction below is appropriate.
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
In reply to (Ovid - try eval)Re: Only
by Ovid
in thread Only
by rrwo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |