Mail::Box::Tie(3) User Contributed Perl Documentation Mail::Box::Tie(3)

Mail::Box::Tie - access an existing message-folder as an array or hash

Mail::Box::Tie is extended by
  Mail::Box::Tie::ARRAY
  Mail::Box::Tie::HASH

As an array:

tie my(@inbox), Mail::Box::Tie::ARRAY => $folder;
print $inbox[3];

or as hash:

tie my(%inbox), Mail::Box::Tie::HASH => $folder;
print $inbox{'<12379.124879@example.com>'};

Folders certainly look like an array of messages, so why not just access them as one? Or, the order is not important, but the message-ids are (give relations): why not access them from a hash based on this message-id? Programs using one of these ties will look simpler than programs using the more traditional method calls.

$class->new($folder, $type)
Do not call this method directly, but via the tie interface.

$obj->folder()
$obj->type()

Cast by new()

This module is part of Mail-Box version 4.01, built on December 13, 2025. Website: http://perl.overmeer.net/CPAN/

For contributors see file ChangeLog.

This software is copyright (c) 2001-2025 by Mark Overmeer.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2025-12-14 perl v5.42.0