line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
######################### -*- Mode: Perl -*- ######################### |
2
|
|
|
|
|
|
|
## |
3
|
|
|
|
|
|
|
## File : Mrequire.pm |
4
|
|
|
|
|
|
|
## |
5
|
|
|
|
|
|
|
## Author : Norbert Goevert |
6
|
|
|
|
|
|
|
## Created On : Fri Oct 16 13:13:11 1998 |
7
|
|
|
|
|
|
|
## Last Modified : Time-stamp: <2003-12-08 17:01:35 goevert> |
8
|
|
|
|
|
|
|
## |
9
|
|
|
|
|
|
|
## Description : require on Perl extensions at run time |
10
|
|
|
|
|
|
|
## |
11
|
|
|
|
|
|
|
## $Id: Mrequire.pm,v 1.6 2003/12/08 16:19:06 goevert Exp $ |
12
|
|
|
|
|
|
|
## |
13
|
|
|
|
|
|
|
###################################################################### |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
518
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
37
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
## ################################################################### |
20
|
|
|
|
|
|
|
## package Mrequire |
21
|
|
|
|
|
|
|
## ################################################################### |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
package Mrequire; |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
1
|
|
5
|
use Exporter; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
26
|
1
|
|
|
1
|
|
4
|
use Carp; |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
76
|
|
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
1
|
|
4
|
use vars qw($VERSION @ISA @EXPORT_OK); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
251
|
|
29
|
|
|
|
|
|
|
'$Name: release_0_6 $ 0_0' =~ /(\d+)[-_](\d+)/; $VERSION = sprintf '%d.%03d', $1, $2; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
@ISA =qw(Exporter); |
32
|
|
|
|
|
|
|
@EXPORT_OK = qw(mrequire); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
## public ############################################################ |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub mrequire ($ ) { |
39
|
|
|
|
|
|
|
|
40
|
1
|
|
|
1
|
1
|
409
|
my $file = shift; |
41
|
|
|
|
|
|
|
|
42
|
1
|
|
|
|
|
5
|
$file =~ s!::!/!g; |
43
|
1
|
|
|
|
|
2
|
$file .= '.pm'; |
44
|
|
|
|
|
|
|
|
45
|
1
|
|
|
|
|
2
|
my $result; |
46
|
|
|
|
|
|
|
|
47
|
1
|
|
|
|
|
1
|
eval { $result = require $file }; |
|
1
|
|
|
|
|
899
|
|
48
|
1
|
50
|
|
|
|
9630
|
if ($@) { |
49
|
0
|
|
|
|
|
0
|
chomp $@; |
50
|
0
|
|
|
|
|
0
|
croak $@; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
1
|
|
|
|
|
3
|
return $result; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
## private ########################################################### |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub AUTOLOAD { |
60
|
|
|
|
|
|
|
|
61
|
1
|
|
|
1
|
|
8
|
my $func = $Mrequire::AUTOLOAD; $func =~ s/.*:://; |
|
1
|
|
|
|
|
5
|
|
62
|
1
|
|
|
|
|
4
|
my $class = $_[0]; |
63
|
|
|
|
|
|
|
|
64
|
1
|
|
|
|
|
2
|
$class .= '::' . $func; |
65
|
|
|
|
|
|
|
|
66
|
1
|
|
|
1
|
|
3
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
67
|
1
|
|
|
|
|
5
|
return &$class(@_); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |
72
|
|
|
|
|
|
|
__END__ |