# Mail::Box::Tie - access an existing message-folder as an array or hash - perldoc - [phpMan]

## NAME
    [Mail::Box::Tie](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3ATie/markdown) - access an existing message-folder as an array or hash

## SYNOPSIS
    As an array:

     use [Mail::Box::Tie](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3ATie/markdown);
     tie my(@inbox), [Mail::Box::Tie::ARRAY](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3ATie%3A%3AARRAY/markdown) => $folder;
     tie my(@inbox), [Mail::Box::Tie](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3ATie/markdown) => $folder;    # deprecated
     print $inbox[3];

    or as hash:

     tie my(%inbox), [Mail::Box::Tie::HASH](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3ATie%3A%3AHASH/markdown) => $folder;
     tie my(%inbox), [Mail::Box::Tie](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3ATie/markdown) => $folder;    # deprecated
     print $inbox{'<<12379.124879@example.com>>'};

## DESCRIPTION
    The use of "[Mail::Box::Tie](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3ATie/markdown)" is deprecated, because it is succeeded by two separate modules:
    [Mail::Box::Tie::ARRAY](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3ATie%3A%3AARRAY/markdown) and [Mail::Box::Tie::HASH](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3ATie%3A%3AHASH/markdown). However, this module still works.

    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.

## METHODS
## SEE ALSO
    This module is part of Mail-Box distribution version 3.010, built on July 18, 2023. Website:
    <http://perl.overmeer.net/CPAN/>

## LICENSE
    Copyrights 2001-2023 by [Mark Overmeer]. For other contributors see ChangeLog.

    This program is free software; you can redistribute it and/or modify it under the same terms as
    Perl itself. See <http://dev.perl.org/licenses/>

