line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pollute::Persistent; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
21
|
use 5.005; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
44
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
5
|
1
|
|
|
1
|
|
6
|
no strict 'refs'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
44
|
|
6
|
|
|
|
|
|
|
# no warnings; # all those subroutine redefinitions :) |
7
|
1
|
|
|
1
|
|
5
|
use vars qw/$Package $VERSION/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
359
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$VERSION = '0.07'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub import{ |
12
|
1
|
|
|
1
|
|
3
|
my ($Package) = caller; |
13
|
1
|
|
|
|
|
2
|
my %Before = map {($_,1)} keys %{"${Package}::"}; |
|
3
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
5
|
|
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
31
|
*{"${Package}::import"} = sub { |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
2
|
my %Symbols; # will be remembered in closure |
18
|
1
|
|
|
|
|
2
|
foreach (keys %{"${Package}::"}){ |
|
1
|
|
|
|
|
5
|
|
19
|
7
|
100
|
|
|
|
15
|
$Before{$_} and next; |
20
|
4
|
|
|
|
|
12
|
$Symbols{"${Package}::$_"} = $_ ; |
21
|
|
|
|
|
|
|
# print "will set *{\"PACKAGE::$_\"} to *{${Package}::$_} \n"; |
22
|
|
|
|
|
|
|
}; |
23
|
1
|
|
|
|
|
4
|
undef %Before; |
24
|
1
|
|
|
|
|
4
|
*{"${Package}::import"} = |
25
|
|
|
|
|
|
|
sub { # may give a redef. warning |
26
|
2
|
|
|
2
|
|
6
|
($Package) = caller; |
27
|
2
|
|
|
|
|
5
|
foreach (keys %Symbols) { |
28
|
|
|
|
|
|
|
# print "setting *{\"${Package}::$Symbols{$_}\"} = *{$_}\n"; |
29
|
8
|
|
|
|
|
10
|
*{"${Package}::$Symbols{$_}"} = *{$_}; |
|
8
|
|
|
|
|
1893
|
|
|
8
|
|
|
|
|
15
|
|
30
|
|
|
|
|
|
|
}; |
31
|
1
|
|
|
|
|
4
|
}; |
32
|
1
|
|
|
|
|
2
|
goto &{"${Package}::import"}; |
|
1
|
|
|
|
|
4
|
|
33
|
1
|
|
|
|
|
14
|
}; |
34
|
|
|
|
|
|
|
}; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
__END__ |