#!/usr/bin/env perl use Getopt::Long; $ME = q|WHATEVER|; sub usage { print STDERR <<'EOS'; Usage: newmod.pl [-u 'Name '] Module::Name EOS exit 1; } GetOptions('user:s' => \$ME) && @ARGV == 1 or usage; $mod = shift; ($dir = $mod) =~ s/::/-/g; mkdir $dir or die $!; chdir $dir; sub cat { my $o = shift; open OUT, ">$o" or die $!; print OUT $_ for @_; close OUT; } ($file = $mod) =~ s/.*:://; cat 'Makefile.PL', < '$mod', VERSION_FROM => '$file.pm', PREREQ_PM => { }, (\$] >= 5.005 ? ## Add these new keywords supported since 5.005 (AUTHOR => q|$ME|) : ()), ABSTRACT => 'Something.', ); EOS cat "$file.pm", < 1; use $mod; ok(1, 'loaded'); EOS (undef, undef, undef, $d, $m, $y) = localtime; $y += 1900; cat "ChangeLog", <