<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/env perl

use Getopt::Long;

$NAME ||= 'AUTHOR_NAME';
$EMAIL ||= 'AUTHOR_EMAIL';
$LICENSE ||= 'perl';
$KWALITEE = 0;

sub usage
{
    print STDERR &lt;&lt;'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;
}

@orig_argv = @ARGV;

GetOptions('name:s' =&gt; \$NAME,
           'email:s' =&gt; \$EMAIL,
           'license:s' =&gt; \$LICENSE
           'kwalitee' =&gt; \$KWALITEE) &amp;&amp; @ARGV == 1 or usage;

$mod = shift;
($dir = $mod) =~ s/::/-/g;
mkdir $dir or die $!;
chdir $dir;

sub cat
{
    my $o = shift;
    open OUT, "&gt;$o" or die $!;
    print OUT @_;
    close OUT;
}

($file = $mod) =~ s/.*:://;
(undef, undef, undef, $d, $m, $y) = localtime;
$y += 1900;

$license = {
    perl =&gt; &lt;&lt;'EOS',
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
EOS
    gpl =&gt; &lt;&lt;'EOS',
This library is free software under the terms of the GNU general public
license.
EOS
}-&gt;{lc $LICENSE} || '';

cat 'Makefile.PL', &lt;&lt;EOS;
use ExtUtils::MakeMaker;

WriteMakefile(
    NAME              =&gt; '$mod',
    VERSION_FROM      =&gt; '$file.pm',
    PREREQ_PM         =&gt; { },
    (\$] &gt;= 5.005 ?     ## Add these new keywords supported since 5.005
      (AUTHOR         =&gt; q|$NAME &lt;$EMAIL&gt;|) : ()),
    ABSTRACT          =&gt; 'Something.',
);
EOS

cat "$file.pm", &lt;&lt;EOS;
package $mod;

=head1 NAME

$mod -- ...

=head1 SYNOPSIS



=cut

\$VERSION = '0.01';

1;
__END__

=head1 DESCRIPTION



=head1 AUTHOR

$NAME, E&lt;lt&gt;${EMAIL}E&lt;gt&gt;

Bug reports welcome, patches even more welcome.

=head1 COPYRIGHT

Copyright (C) $y, $NAME.
$license

=cut
EOS

cat "test.pl", &lt;&lt;EOS;
use Test::Simple tests =&gt; 1;
use $mod;
ok(1, 'loaded');
EOS

cat "ChangeLog", &lt;&lt;EOS;
$y-$m-$d  $NAME &lt;$EMAIL&gt;
	* original version; created by $0 @orig_argv
EOS

cat "README", &lt;&lt;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', &lt;&lt;EOS;
Makefile.PL
MANIFEST
README
test.pl
$file.pm
EOS
</pre></body></html>