use Mail::Box::Tie; tie my(@inbox), Mail::Box::Tie::ARRAY => $folder; tie my(@inbox), Mail::Box::Tie => $folder; # deprecated print $inbox[3];
or as hash:
tie my(%inbox), Mail::Box::Tie::HASH => $folder; tie my(%inbox), Mail::Box::Tie => $folder; # deprecated 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.
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/