Last active
September 25, 2020 10:29
-
-
Save worthmine/14f04b825dc11cb5da811f47d83965fb to your computer and use it in GitHub Desktop.
trying to detect for NOT (CORE|EXSISTING) module names in Perl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use 5.008_009; # because Module::CoreList was first released with perl v5.8.9 | |
#use strict; # this line is irrelevant | |
#use warnings; # this line is irrelevant | |
use feature qw(say); | |
#use FastGlob qw(glob); # this line is irrelevant | |
my @modules = qw(Encode FastGlob CGI Dummy); | |
#local @INC = qw(lib); # this line is irrelevant | |
my @list; | |
for (@modules) { | |
eval { require $_ } or $@ =~ /^Can't locate ([A-Za-z][^\s]+)/; | |
say "for $1" if my $name = $1; | |
say my $res = qx"corelist $name"; | |
push @list, $name if $res =~ /$name was not in CORE/; | |
} | |
say 'results:'; | |
say "- $_" for @list; | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment