Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: eval array of required modules

by farang (Chaplain)
on Apr 02, 2014 at 21:15 UTC ( #1080835=note: print w/ replies, xml ) Need Help??


in reply to eval array of required modules

One solution is an eval expression with explicit $_

#!/usr/bin/env perl -l use strict; use warnings; my @required = qw( File::Basename File::Copy File::Find ); my @missing; foreach (@required) { eval "require $_"; push @missing, $_ if $@; } print "missing---> @missing" if @missing; print for sort grep m{^File/[BCF]} => keys %INC; __END__ File/Basename.pm File/Copy.pm File/Find.pm

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (13)
As of 2016-06-28 21:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (363 votes). Check out past polls.