line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::Hello; |
2
|
|
|
|
|
|
|
$Acme::Hello::VERSION = '0.05'; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
157546
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
45
|
|
5
|
1
|
|
|
1
|
|
1046
|
use Acme::Hello::I18N; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
42
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use Exporter; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
50
|
|
8
|
1
|
|
|
1
|
|
5
|
use base 'Exporter'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
291
|
|
9
|
1
|
|
|
1
|
|
7
|
use vars '@EXPORT'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
323
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
@EXPORT = 'hello'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Acme::Hello - Print a greeting message |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 VERSION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
This document describes version 0.04 of B. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
use Acme::Hello; # exports hello() by default |
24
|
|
|
|
|
|
|
hello(); # procedure call interface |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $obj = Acme::Hello->new; |
27
|
|
|
|
|
|
|
$obj->hello; # object-oriented interface |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub new { |
32
|
2
|
|
|
2
|
0
|
10
|
my ($class, %args) = @_; |
33
|
2
|
50
|
|
|
|
7
|
$class = ref($class) if (ref $class); |
34
|
|
|
|
|
|
|
|
35
|
2
|
0
|
33
|
|
|
36
|
$args{lh} ||= Acme::Hello::I18N->get_handle($args{language}) |
36
|
|
|
|
|
|
|
or die "Cannot find handle for language: $args{language}.\n"; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
0
|
return bless(\%args, $class); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub hello { |
42
|
1
|
50
|
|
1
|
0
|
41
|
my $self = ref($_[0]) ? $_[0] : __PACKAGE__->new; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
print $self->loc("Hello, world!"), "\n"; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub lh { |
48
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
49
|
0
|
0
|
|
|
|
|
$self->{lh} = shift if @_; |
50
|
0
|
|
|
|
|
|
return $self->{lh}; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub loc { |
54
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
55
|
0
|
|
|
|
|
|
return $self->lh->maketext(@_); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |