| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
=encoding UTF-8 |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Acme::Include::Data - it's easy to include data with a CPAN module |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use Acme::Include::Data; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
This is a demonstration module which demonstrates how to include a |
|
14
|
|
|
|
|
|
|
data file with a Perl module and how to read it in at run time. |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 FUNCTIONS |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head2 yes_it_works |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
This is a function for testing the module. |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Please see L for more explanation. |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 LICENCE |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
You can use, redistribute, and modify this under the same |
|
29
|
|
|
|
|
|
|
terms as Perl itself. |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
|
32
|
|
|
|
|
|
|
package Acme::Include::Data; |
|
33
|
|
|
|
|
|
|
require Exporter; |
|
34
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
|
35
|
|
|
|
|
|
|
@EXPORT_OK = qw/yes_it_works/; |
|
36
|
|
|
|
|
|
|
%EXPORT_TAGS = ( |
|
37
|
|
|
|
|
|
|
all => \@EXPORT_OK, |
|
38
|
|
|
|
|
|
|
); |
|
39
|
1
|
|
|
1
|
|
40269
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
32
|
|
|
40
|
1
|
|
|
1
|
|
5
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
35
|
|
|
41
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
|
1
|
|
|
|
|
6
|
|
|
|
1
|
|
|
|
|
234
|
|
|
42
|
|
|
|
|
|
|
our $VERSION = 0.04; |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
my $data = __FILE__; |
|
46
|
|
|
|
|
|
|
$data =~ s/Data\.pm$/this-is-a-data-file.txt/; |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
open my $in, "<", $data or die $!; |
|
49
|
|
|
|
|
|
|
my $text = ''; |
|
50
|
|
|
|
|
|
|
while (<$in>) { |
|
51
|
|
|
|
|
|
|
$text .= $_; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub yes_it_works |
|
55
|
|
|
|
|
|
|
{ |
|
56
|
1
|
|
|
1
|
1
|
13
|
return $text; |
|
57
|
|
|
|
|
|
|
} |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |