line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MemHandle; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
548
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
4
|
1
|
|
|
1
|
|
4
|
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
76
|
|
5
|
|
|
|
|
|
|
require IO::Handle; |
6
|
|
|
|
|
|
|
require IO::Seekable; |
7
|
1
|
|
|
1
|
|
761
|
use Symbol; |
|
1
|
|
|
|
|
940
|
|
|
1
|
|
|
|
|
83
|
|
8
|
1
|
|
|
1
|
|
584
|
use MemHandle::Tie; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
45
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
require Exporter; |
11
|
1
|
|
|
1
|
|
14
|
use 5.000; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
193
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
@ISA = qw(IO::Handle IO::Seekable Exporter); |
14
|
|
|
|
|
|
|
# Items to export into callers namespace by default. Note: do not export |
15
|
|
|
|
|
|
|
# names by default without a very good reason. Use EXPORT_OK instead. |
16
|
|
|
|
|
|
|
# Do not simply export all your public functions/methods/constants. |
17
|
|
|
|
|
|
|
@EXPORT = qw( |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
$VERSION = '0.07'; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Preloaded methods go here. |
24
|
|
|
|
|
|
|
sub new { |
25
|
1
|
|
|
1
|
1
|
43
|
my( $class, $mem ) = @_; |
26
|
1
|
|
50
|
|
|
10
|
$class = ref( $class ) || $class || 'MemHandle'; |
27
|
1
|
|
|
|
|
7
|
my $fh = gensym; |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
|
|
25
|
${*$fh} = tie *$fh, 'MemHandle::Tie', $mem; |
|
1
|
|
|
|
|
3
|
|
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
|
|
4
|
bless $fh, $class; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub seek { |
35
|
1
|
|
|
1
|
1
|
15
|
my $fh = shift; |
36
|
1
|
|
|
|
|
2
|
${*$fh}->SEEK( @_ ); |
|
1
|
|
|
|
|
16
|
|
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub tell { |
40
|
0
|
|
|
0
|
1
|
0
|
my $fh = shift; |
41
|
0
|
|
|
|
|
0
|
${*$fh}->TELL( @_ ); |
|
0
|
|
|
|
|
0
|
|
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub mem { |
45
|
1
|
|
|
1
|
1
|
6
|
my $fh = shift; |
46
|
1
|
|
|
|
|
3
|
${*$fh}->mem( @_ ); |
|
1
|
|
|
|
|
6
|
|
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# Autoload methods go after =cut, and are processed by the autosplit program. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
__END__ |