Finding the packages in a required file

Kent Fredric kentfredric at gmail.com
Sat May 24 15:31:19 BST 2014


On 25 May 2014 01:47, Simon Wistow <simon at thegestalt.org> wrote:

> But attempting to parse the file using regexes feels icky.
>


There's an established and recognised way to get package names out of
arbitrary files.

And its even in core since 5.13.9 :)


https://metacpan.org/pod/Module::Metadata

push @modules, Module::Metadata->new_from_file($path)->packages_inside()

^ Aught to be better than an icky regex.


-- 
Kent


More information about the london.pm mailing list