line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package scriptname; |
2
|
|
|
|
|
|
|
# ABSTRACT: Locate original perl script |
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
78684
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
106
|
|
5
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
81
|
|
6
|
3
|
|
|
3
|
|
73
|
use 5.000; |
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
2138
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my($myname, $mybase, $mydir); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
BEGIN { |
11
|
3
|
|
|
3
|
|
7
|
our $VERSION = '0.92'; |
12
|
3
|
|
|
|
|
4
|
our $AUTHORITY = 'MASSA'; |
13
|
|
|
|
|
|
|
|
14
|
3
|
|
|
3
|
|
17
|
use Carp; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
325
|
|
15
|
3
|
|
|
3
|
|
15
|
use Cwd qw(realpath cwd); |
|
3
|
|
|
|
|
17
|
|
|
3
|
|
|
|
|
161
|
|
16
|
3
|
|
|
3
|
|
16
|
use File::Basename qw(basename dirname); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
537
|
|
17
|
|
|
|
|
|
|
|
18
|
3
|
50
|
33
|
|
|
33
|
if( $0 eq '-' || $0 eq '-e' ) { |
19
|
0
|
|
|
|
|
0
|
$mydir = cwd |
20
|
|
|
|
|
|
|
} else { |
21
|
3
|
|
|
|
|
203
|
$myname = $0 = realpath $0; |
22
|
3
|
|
|
|
|
462
|
$mybase = basename $0, qw(.t .pm .pl .perl .exe .com .bat); |
23
|
3
|
|
|
|
|
124
|
$mydir = dirname $0; |
24
|
3
|
50
|
|
|
|
71
|
croak 'chdir() too early' unless -f $0 |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
3
|
|
|
3
|
|
2379
|
use lib; |
|
3
|
|
|
|
|
2038
|
|
|
3
|
|
|
|
|
13
|
|
28
|
3
|
|
|
3
|
|
162
|
use Exporter; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
209
|
|
29
|
3
|
|
|
|
|
15
|
our @EXPORT_OK = qw(myname mybase mydir); |
30
|
3
|
|
|
|
|
868
|
our %EXPORT_TAGS = (all => [@EXPORT_OK]); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
0
|
1
|
0
|
sub myname() { $myname } ## no critic |
34
|
1
|
|
|
1
|
1
|
344
|
sub mybase() { $mybase } ## no critic |
35
|
2
|
|
|
2
|
1
|
275
|
sub mydir() { $mydir } ## no critic |
36
|
4
|
100
|
|
4
|
|
353
|
sub _mylib { map realpath("$mydir/$_"), (@_ ? @_ : qw(./lib)) } |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub import { |
39
|
3
|
|
|
3
|
|
25
|
my $package = shift; |
40
|
3
|
100
|
|
|
|
22
|
return unless @_; |
41
|
2
|
|
|
|
|
4
|
my $first_tag = shift; |
42
|
2
|
50
|
33
|
|
|
18
|
return lib->import(_mylib @_) if defined $first_tag and $first_tag eq 'lib'; |
43
|
0
|
|
|
|
|
0
|
Exporter::import($package, $first_tag, @_) |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub unimport { |
47
|
2
|
|
|
2
|
|
15363
|
my $package = shift; |
48
|
2
|
50
|
|
|
|
12
|
return unless @_; |
49
|
2
|
|
|
|
|
4
|
my $first_tag = shift; |
50
|
2
|
50
|
33
|
|
|
23
|
lib->unimport(_mylib @_) if defined $first_tag and $first_tag eq 'lib' |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# Magic true value required at end of module |
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |