1Mail::Box::Tie(3) User Contributed Perl Documentation Mail::Box::Tie(3)
2
3
4
6 Mail::Box::Tie - access an existing message-folder as an array or hash
7
9 As an array:
10
11 use Mail::Box::Tie;
12 tie my(@inbox), Mail::Box::Tie::ARRAY => $folder;
13 tie my(@inbox), Mail::Box::Tie => $folder; # deprecated
14 print $inbox[3];
15
16 or as hash:
17
18 tie my(%inbox), Mail::Box::Tie::HASH => $folder;
19 tie my(%inbox), Mail::Box::Tie => $folder; # deprecated
20 print $inbox{'<12379.124879@example.com>'};
21
23 The use of "Mail::Box::Tie" is deprecated, because it is succeeded by
24 two separate modules: Mail::Box::Tie::ARRAY and Mail::Box::Tie::HASH.
25 However, this module still works.
26
27 Folders certainly look like an array of messages, so why not just
28 access them as one? Or, the order is not important, but the message-
29 ids are (give relations): why not access them from a hash based on this
30 message-id? Programs using one of these ties will look simpler than
31 programs using the more traditional method calls.
32
35 This module is part of Mail-Box distribution version 3.009, built on
36 August 18, 2020. Website: http://perl.overmeer.net/CPAN/
37
39 Copyrights 2001-2020 by [Mark Overmeer]. For other contributors see
40 ChangeLog.
41
42 This program is free software; you can redistribute it and/or modify it
43 under the same terms as Perl itself. See http://dev.perl.org/licenses/
44
45
46
47perl v5.34.0 2021-07-22 Mail::Box::Tie(3)