line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package IO::All::File; |
2
|
3
|
|
|
3
|
|
1579
|
use IO::All::Base; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
24
|
|
3
|
|
|
|
|
|
|
extends 'IO::All::Filesys'; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
option 'utf8'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has handle => (); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Upgrade from IO::All to IO::All::Dir |
10
|
3
|
|
|
3
|
|
21
|
use constant upgrade_methods => [qw(file print)]; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
1320
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub can_upgrade { |
13
|
4
|
|
|
4
|
0
|
10
|
my ($self, $object) = @_; |
14
|
4
|
|
|
|
|
14
|
my $location = $object->location; |
15
|
|
|
|
|
|
|
return if |
16
|
4
|
100
|
66
|
|
|
39
|
not defined $location or |
17
|
|
|
|
|
|
|
not length $location; |
18
|
3
|
|
|
|
|
74
|
-f $location; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# |
22
|
|
|
|
|
|
|
# Worker Methods: |
23
|
|
|
|
|
|
|
# |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub file { |
26
|
2
|
|
|
2
|
0
|
4
|
my $self = shift; |
27
|
2
|
100
|
|
|
|
10
|
$self->name(shift) if @_; |
28
|
2
|
|
|
|
|
9
|
return $self; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub open { |
32
|
3
|
|
|
3
|
0
|
5
|
my $self = shift; |
33
|
3
|
|
|
|
|
5
|
my $fh; |
34
|
3
|
|
|
|
|
19
|
open $fh, '<', $self->name; |
35
|
3
|
|
|
|
|
14
|
$self->handle($fh); |
36
|
3
|
|
|
|
|
11
|
return $self; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub all { |
40
|
3
|
|
|
3
|
0
|
5
|
my $self = shift; |
41
|
3
|
|
|
|
|
17
|
my $fh = $self->open->handle; |
42
|
3
|
|
|
|
|
7
|
return do { local $/; <$fh> } |
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
109
|
|
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub print { |
46
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
47
|
0
|
|
|
|
|
|
CORE::print(@_); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |