The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

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

SYNOPSIS

As array:

   use Mail::Box::Tie;
   tie my(@inbox), 'Mail::Box::Tie::ARRAY', $folder;
   tie my(@inbox), 'Mail::Box::Tie', $folder; # depricated
   print $inbox[3];

or as hash:

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

DESCRIPTION

Read Mail::Box::Manager first. The use of Mail::Box::Tie is depricated, and replaced by two seperate modules. 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.

See Mail::Box::Tie::ARRAY and Mail::Box::Tie::HASH

#-------------------------------------------

sub TIEHASH(@) { my $class = shift . "::HASH"; eval "require $class"; # bootstrap

    confess $@ if $@;
    $class->TIEHASH(@_);
}

sub TIEARRAY(@) { my $class = shift . "::ARRAY"; eval "require $class"; # bootstrap

    confess $@ if $@;
    $class->TIEARRAY(@_);
}

#-------------------------------------------

AUTHOR

Mark Overmeer (Mark@Overmeer.net). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

VERSION

This code is beta, version 1.3.19