-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathmkpm.pl
executable file
·50 lines (42 loc) · 1.13 KB
/
mkpm.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/perl
# Script: mkpm.pl
# Description: Sets up a perl module template with comments and standard info
# Author: Steven Ahrendt
# email: [email protected]
# Date: 03.18.2014
##################################
use warnings;
use strict;
use Getopt::Long;
use Time::Piece;
#####-----Global Variables-----#####
my $input;
my $desc = "";
my ($help,$verb);
my $date = Time::Piece->new->strftime('%m.%d.%Y');
GetOptions ('i|input=s' => \$input,
'd|description=s' => \$desc,
'h|help' => \$help,
'v|verbose' => \$verb);
my $usage = "Usage: mkpm.pl -i input [-d description]\n";
die $usage if $help;
die "No input.\n$usage" if (!$input);
#####-----Main-----#####
my $mod = (split(/\./,$input))[0];
open (OUT,">$input");
print OUT 'package '.$mod.';
# Name: '.$input.'
# Description: '.$desc.'
# Author: Steven Ahrendt
# email: [email protected]
# Date: '.$date.'
#######################
use strict;
use base \'Exporter\'; # to export our subroutines
our @EXPORT; # export always
our @EXPORT_OK; # export sometimes
1;';
close(OUT);
warn "Done.\n";
exit(0);
#####-----Subroutines-----######!/usr/bin/perl