line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Header: /home/fergal/my/cvs/Code-Perl/lib/Code/Perl/Expr/DerefHash.pm,v 1.1 2003/06/17 14:14:21 fergal Exp $ |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Code::Perl::Expr::DerefHash; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
4
|
use base qw( Code::Perl::Expr::Base ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
70
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use Class::MethodMaker ( |
10
|
1
|
|
|
|
|
31
|
get_set => [qw( -java Key Ref )] |
11
|
1
|
|
|
1
|
|
4
|
); |
|
1
|
|
|
|
|
1
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub eval |
14
|
|
|
|
|
|
|
{ |
15
|
2
|
|
|
2
|
0
|
5
|
my $self = shift; |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
|
|
75
|
my $hash = $self->getRef->eval; |
18
|
|
|
|
|
|
|
|
19
|
2
|
|
|
|
|
65
|
return $hash->{$self->getKey->eval}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub perl |
23
|
|
|
|
|
|
|
{ |
24
|
2
|
|
|
2
|
0
|
5
|
my $self = shift; |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
128
|
my $hash_perl = $self->getRef->perl; |
27
|
|
|
|
|
|
|
|
28
|
2
|
|
|
|
|
78
|
my $index = $self->getKey->perl; |
29
|
2
|
|
|
|
|
9
|
return "($hash_perl)->{$index}"; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |