How to create cpanfile by "perl Makefile.PL"?

Yuki Kimoto - SPVM Author - Dec 11 '22 - - Dev Community

How to create cpanfile by "perl Makefile.PL"?

ExtUtils::MakeMaker::CPANfile makes it possible.

# Makefile.PL
use ExtUtils::MakeMaker::CPANfile;

WriteMakefile(
  NAME => 'Foo::Bar',
  AUTHOR => 'A.U.Thor <author@cpan.org>',
);

# cpanfile
requires 'ExtUtils::MakeMaker' => '6.17';
on test => sub {
  requires 'Test::More' => '0.88';
};
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .