| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# This code is part of Perl distribution Mail-Box version 4.01. |
|
2
|
|
|
|
|
|
|
# The POD got stripped from this file by OODoc version 3.05. |
|
3
|
|
|
|
|
|
|
# For contributors see file ChangeLog. |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# This software is copyright (c) 2001-2025 by Mark Overmeer. |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under |
|
8
|
|
|
|
|
|
|
# the same terms as the Perl 5 programming language system itself. |
|
9
|
|
|
|
|
|
|
# SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Mail::Box::Tie::ARRAY;{ |
|
13
|
|
|
|
|
|
|
our $VERSION = '4.01'; |
|
14
|
|
|
|
|
|
|
} |
|
15
|
|
|
|
|
|
|
|
|
16
|
2
|
|
|
2
|
|
3125
|
use parent 'Mail::Box::Tie'; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
14
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
2
|
|
|
2
|
|
97
|
use strict; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
55
|
|
|
19
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
121
|
|
|
20
|
|
|
|
|
|
|
|
|
21
|
2
|
|
|
2
|
|
10
|
use Log::Report 'mail-box', import => [ qw/__x error/ ]; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
11
|
|
|
22
|
|
|
|
|
|
|
|
|
23
|
2
|
|
|
2
|
|
335
|
use Scalar::Util qw/blessed/; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
923
|
|
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
#-------------------- |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub TIEARRAY(@) |
|
28
|
1
|
|
|
1
|
|
4
|
{ my ($class, $folder) = @_; |
|
29
|
1
|
|
|
|
|
13
|
$class->new($folder, 'ARRAY'); |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
#-------------------- |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
#-------------------- |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub FETCH($) |
|
37
|
3
|
|
|
3
|
|
766
|
{ my ($self, $index) = @_; |
|
38
|
3
|
|
|
|
|
11
|
my $msg = $self->folder->message($index); |
|
39
|
3
|
50
|
|
|
|
21
|
$msg->isDeleted ? undef : $msg; |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub STORE($$) |
|
44
|
0
|
|
|
0
|
|
0
|
{ my ($self, $index, $msg) = @_; |
|
45
|
0
|
|
|
|
|
0
|
my $folder = $self->folder; |
|
46
|
|
|
|
|
|
|
|
|
47
|
0
|
0
|
|
|
|
0
|
$index == $folder->messages |
|
48
|
|
|
|
|
|
|
or error __x"cannot simply replace messages in a folder: use delete old, then push new."; |
|
49
|
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
0
|
$folder->addMessages($msg); |
|
51
|
0
|
|
|
|
|
0
|
$msg; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
|
55
|
6
|
|
|
6
|
|
1295
|
sub FETCHSIZE() { scalar $_[0]->folder->messages } |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub PUSH(@) |
|
59
|
2
|
|
|
2
|
|
74047
|
{ my $folder = shift->folder; |
|
60
|
2
|
|
|
|
|
19
|
$folder->addMessages(@_); |
|
61
|
2
|
|
|
|
|
9
|
scalar $folder->messages; |
|
62
|
|
|
|
|
|
|
} |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
|
65
|
1
|
|
|
1
|
|
360
|
sub DELETE($) { $_[0]->folder->message($_[1])->delete } |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub STORESIZE($) |
|
69
|
0
|
|
|
0
|
|
|
{ my $folder = $_[0]->folder; |
|
70
|
0
|
|
|
|
|
|
my $length = $_[1]; |
|
71
|
0
|
|
|
|
|
|
$folder->message($_) for $length..$folder->messages; |
|
72
|
0
|
|
|
|
|
|
$length; |
|
73
|
|
|
|
|
|
|
} |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
# DESTROY is implemented in Mail::Box |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
#-------------------- |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |