Perl Builder12/1/2023 ![]() $ perl -ne 'chomp system "./find_binary $_"' perl522_programs I run it like this: $ chmod 755 find_binary #!/usr/bin/perl my $bin = shift or die "You must provide a binary name to search for\n" įor ( qw(/sbin /bin /usr/sbin /usr/bin) ) Then I used the following script, called find_binary to check for the programs: What about programs? To search for Perl programs I prepared a list of Perl programs from the source for Perl 5.22, called perl522_programs: c2ph So the program output needs to be tidied up in a text editor. Another issue is it will list duplicate modules when the system uses symlinks. pm file) rather than every distribution, (see this explanation if you’re not familiar with the distinction). One downside of this approach is it lists every module (. I’m using the absolute path /usr/bin/perl to ensure I get my system’s perl and not the local one I manage with plenv. = '/' unless substr($dirpath, - 1) eq '/' A simple way I handle this is to use the following script to search the contents of the directories which perl searches for modules:ĭie "-dir is required\n" unless $dirpath & -d $dirpath Perldoc won’t show us the core modules that we already have, and in the case of missing core modules, Module::CoreList can’t help either (its results are based on internal lists of modules that should be there, not which files are actually present). Sometimes instead of asking which modules are in the Perl Core what we really mean is: “which modules do I have installed?” For non-core modules, I use perldoc. If you don’t have corelist, but want to view a list of distributions that should have been bundled with your version of Perl, you can read perldoc perlmodlib. Not only that, but great core modules like Time::Piece aren’t included either! The program doesn’t exist the Fedora team didn’t include it for some reason. Running the system Perl corelist: $ sudo corelist -a Module::CoreList At home I run Fedora 23, which comes with Perl version 5.22.1. It shows that Module::CoreList has been included since Perl version 5.8.9. I’ve truncated the output and kept the key details. Module::CoreList was first released with perl v5.8.9 Let’s see when Module::CoreList first shipped with Perl: $ corelist -a Module::CoreList Luckily there is a better solution: the corelist program. What modules are included in the Perl Core?ĭid you know that HTTP::Tiny has shipped with Perl since 2011 (version 5.14.0)? It’s not listed on perldoc (although that is on the list to be fixed at the next QA Hackathon). The problem though, is that it can be wrong. The perldoc site has a handy alphabetized list of core modules and I generally check there first to browse which modules are in core. Knowing which modules are in the Perl Core is useful it enables developers to build programs without external dependencies over which the developer has little control. When I use the term “Perl Core” I mean the standard library of modules (distributions actually) that ship with the perl interpreter, and I think that’s what most people mean when they use that term. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |