Skip to content

Instantly share code, notes, and snippets.

@cxw42
Created May 29, 2019 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cxw42/b4a84ef43f7d2b0f51185e196ea11263 to your computer and use it in GitHub Desktop.
Save cxw42/b4a84ef43f7d2b0f51185e196ea11263 to your computer and use it in GitHub Desktop.
Creating a cpanfile from dependency information in Makefile.PL
#!perl
# Make a cpanfile from the dependencies in Makefile.PL.
# Modified from https://github.com/miyagawa/cpanfile/blob/master/README.md
# by miyagawa
use CPAN::Meta;
use Module::CPANfile;
die "Could not run Makefile.PL"
unless system($^X, 'Makefile.PL') == 0;
my $meta = CPAN::Meta->load_file("MYMETA.json");
my $file = Module::CPANfile->from_prereqs($meta->prereqs);
$file->save("cpanfile");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment