-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathmkpl.pl
executable file
·52 lines (41 loc) · 1.07 KB
/
mkpl.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
51
52
#!/usr/bin/perl
# Script: mkpl.pl
# Description: Sets up perl skeleton script
use warnings;
use strict;
use Time::Piece;
use Getopt::Long;
my $date = Time::Piece->new->strftime('%m.%d.%Y');
my $input;
my $desc = "";
GetOptions ('i|input=s' => \$input,
'd|description=s' => \$desc);
my $usage = "Usage: mkpl.pl -i input [-d desc]\n";
die "No input.\n$usage" if (!$input);
open(OUT,'>',$input);
print OUT '#!/usr/bin/perl
# Script: '.$input.'
# Description: '.$desc.'
# Author: Steven Ahrendt
# email: [email protected]
# Date: '.$date.'
##################################
use warnings;
use strict;
use Getopt::Long;
use lib \'/rhome/sahrendt/Scripts\';
#####-----Global Variables-----#####
my $input;
my ($help,$verb);
GetOptions (\'i|input=s\' => \\$input,
\'h|help\' => \\$help,
\'v|verbose\' => \\$verb);
my $usage = "Usage: '.$input.' -i input\n'.$desc.'\n";
die $usage if $help;
die "No input.\n$usage" if (!$input);
#####-----Main-----#####
warn "Done.\n";
exit(0);
#####-----Subroutines-----#####';
close(OUT);
print `chmod 744 $input`;