sub usage
{
print STDERR <<'EOS';
Usage: newmod.pl [options] Module::Name
--name X Use author name X.
--email X Use author email X.
--license X Use license X (e.g. "perl").
--kwalitee Add boilerplate to increase kwalitee.
EOS
exit 1;
}
$license = {
perl => <<'EOS',
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
EOS
gpl => <<'EOS',
This library is free software under the terms of the GNU general public
license.
EOS
}->{lc $LICENSE} || '';
cat 'Makefile.PL', <<EOS;
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => '$mod',
VERSION_FROM => '$file.pm',
PREREQ_PM => { },
(\$] >= 5.005 ? ## Add these new keywords supported since 5.005
(AUTHOR => q|$NAME <$EMAIL>|) : ()),
ABSTRACT => 'Something.',
);
EOS
cat "$file.pm", <<EOS;
package $mod;
=head1 NAME
$mod -- ...
=head1 SYNOPSIS
=cut
\$VERSION = '0.01';
1;
__END__
=head1 DESCRIPTION
=head1 AUTHOR
$NAME, E<lt>${EMAIL}E<gt>
Bug reports welcome, patches even more welcome.
=head1 COPYRIGHT
Copyright (C) $y, $NAME.
$license
=cut
EOS
cat "test.pl", <<EOS;
use Test::Simple tests => 1;
use $mod;
ok(1, 'loaded');
EOS
cat "ChangeLog", <<EOS;
$y-$m-$d $NAME <$EMAIL>
* original version; created by $0 @orig_argv
EOS
cat "README", <<EOS;
$mod version 0.01
INSTALLATION
To install this module, run the following commands:
perl Makefile.PL
make
make test
make install
DEPENDENCIES
COPYRIGHT AND LICENSE
Copyright (C) $y, $NAME
$license
EOS
cat 'MANIFEST', <<EOS;
Makefile.PL
MANIFEST
README
test.pl
$file.pm
EOS