Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: checking for all packages

by philipbailey (Deacon)
on May 16, 2014 at 19:50 UTC ( #1086384=note: print w/replies, xml ) Need Help??


in reply to checking for all packages

There's no doubt some more sophisticated way of doing this, but I'd probably just try to require each package in turn in a string eval. This should give you the idea:

#!/usr/bin/perl use strict; use warnings; my @packages = qw/ Net::IP Net::CIDR List::BinarySearch /; for my $package (@packages) { eval "require $package"; if ($@) { print "Couldn't find package '$package'\n"; } else { print "Found package '$package'\n"; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1086384]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2022-01-19 15:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (55 votes). Check out past polls.

    Notices?