=encoding utf8

=head1 NAME

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

=head1 INHERITANCE

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

=head1 SYNOPSIS

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>'};

=head1 DESCRIPTION

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.

=head1 METHODS

=head2 Constructors

=over 4

=item $class-E<gt>B<new>($folder, $type)

Do not call this method directly, but via the tie interface.

=back

=head2 Attributes

=over 4

=item $obj-E<gt>B<folder>()

Z<>

=item $obj-E<gt>B<type>()

Z<>

=back

=head1 DIAGNOSTICS

=over 4

=item Error: no folder specified to tie to.

Cast by C<new()>

=back

=head1 SEE ALSO

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

=head1 LICENSE

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.

