line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
2
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
40
|
|
3
|
|
|
|
|
|
|
package Email::Folder::MH; |
4
|
|
|
|
|
|
|
{ |
5
|
|
|
|
|
|
|
$Email::Folder::MH::VERSION = '0.858'; |
6
|
|
|
|
|
|
|
} |
7
|
|
|
|
|
|
|
# ABSTRACT: reads raw RFC822 mails from an mh folder |
8
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
58
|
|
9
|
1
|
|
|
1
|
|
827
|
use IO::File; |
|
1
|
|
|
|
|
10811
|
|
|
1
|
|
|
|
|
175
|
|
10
|
1
|
|
|
1
|
|
554
|
use Email::Folder::Reader; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
26
|
|
11
|
1
|
|
|
1
|
|
765
|
use parent 'Email::Folder::Reader'; |
|
1
|
|
|
|
|
303
|
|
|
1
|
|
|
|
|
4
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub _what_is_there { |
15
|
1
|
|
|
1
|
|
1
|
my $self = shift; |
16
|
1
|
|
|
|
|
2
|
my $dir = $self->{_file}; |
17
|
|
|
|
|
|
|
|
18
|
1
|
50
|
|
|
|
19
|
croak "$dir does not exist" unless (-e $dir); |
19
|
1
|
50
|
|
|
|
14
|
croak "$dir is not a directory" unless (-d $dir); |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
|
|
1
|
my @messages; |
22
|
1
|
50
|
|
|
|
30
|
opendir(DIR,"$dir") or croak "Could not open '$dir'"; |
23
|
1
|
|
|
|
|
13
|
foreach my $file (readdir DIR) { |
24
|
6
|
50
|
|
|
|
13
|
if ($^O eq 'VMS'){ |
25
|
0
|
0
|
|
|
|
0
|
next unless $file =~ /\A\d+\.\Z/; |
26
|
|
|
|
|
|
|
} else { |
27
|
6
|
100
|
|
|
|
22
|
next unless $file =~ /\A\d+\Z/; |
28
|
|
|
|
|
|
|
} |
29
|
4
|
|
|
|
|
10
|
push @messages, "$dir/$file"; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
6
|
$self->{_messages} = \@messages; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub next_message { |
36
|
5
|
|
|
5
|
1
|
6
|
my $self = shift; |
37
|
5
|
|
66
|
|
|
22
|
my $what = $self->{_messages} || $self->_what_is_there; |
38
|
|
|
|
|
|
|
|
39
|
5
|
100
|
|
|
|
14
|
my $file = shift @$what or return; |
40
|
4
|
|
|
|
|
9
|
local *FILE; |
41
|
4
|
50
|
|
|
|
134
|
open FILE, $file or croak "couldn't open '$file' for reading"; |
42
|
4
|
|
|
|
|
211
|
join '', ; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |