{
    "content": [
        {
            "type": "text",
            "text": "# Mail::Box::Tie::HASH (perldoc)\n\n## NAME\n\nMail::Box::Tie::HASH - access an existing message folder as a hash\n\n## SYNOPSIS\n\ntie my(%inbox), 'Mail::Box::Tie::HASH', $folder;\nforeach my $msgid (keys %inbox)\n{   print $inbox{$msgid};\ndelete $inbox{$msgid};\n}\n$inbox{$msg->messageId} = $msg;\n\n## DESCRIPTION\n\nCertainly when you look at a folder as being a set of related messages based on message-id, it\nis logical to access the folder through a hash.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS** (2 subsections)\n- **SEE ALSO**\n- **LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Mail::Box::Tie::HASH",
        "section": "",
        "mode": "perldoc",
        "summary": "Mail::Box::Tie::HASH - access an existing message folder as a hash",
        "synopsis": "tie my(%inbox), 'Mail::Box::Tie::HASH', $folder;\nforeach my $msgid (keys %inbox)\n{   print $inbox{$msgid};\ndelete $inbox{$msgid};\n}\n$inbox{$msg->messageId} = $msg;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Constructors",
                        "lines": 9
                    },
                    {
                        "name": "Tied Interface",
                        "lines": 65
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Mail::Box::Tie::HASH - access an existing message folder as a hash\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "tie my(%inbox), 'Mail::Box::Tie::HASH', $folder;\n\nforeach my $msgid (keys %inbox)\n{   print $inbox{$msgid};\ndelete $inbox{$msgid};\n}\n\n$inbox{$msg->messageId} = $msg;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Certainly when you look at a folder as being a set of related messages based on message-id, it\nis logical to access the folder through a hash.\n\nFor a tied hash, the message-id is used as the key. The message-id is usually unique, but when\ntwo or more instances of the same message are in the same folder, one will be flagged for\ndeletion and the other will be returned.\n\nThis implementation uses basic folder access routines which are related to the message-id.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Constructors",
                        "content": "TIEHASH('Mail::Box::Tie::HASH', FOLDER)\nConnects the FOLDER object to a HASH.\n\nexample:\n\nmy $mgr    = Mail::Box::Manager->new;\nmy $folder = $mgr->open(access => 'rw');\ntie my(%inbox), 'Mail::Box::Tie::HASH', $folder;\n"
                    },
                    {
                        "name": "Tied Interface",
                        "content": "$obj->CLEAR()\nRemove the contents of the hash. This is not really possible, but all the messages will be\nflagged for deletion.\n\nexample:\n\n%inbox = ();\n%inbox = ($msg->messageId, $msg); #before adding msg\n\n$obj->DELETE($messageid)\nRemove the message with the specified $messageid.\n\nexample:\n\ndelete $inbox{$msgid};\n\n$obj->EXISTS($messageid)\nCheck whether a message with a certain $messageid exists.\n\nexample:\n\nif(exists $inbox{$msgid}) ...\n\n$obj->FETCH($messageid)\nGet the message with the specified id. The returned message may be a dummy if message thread\ndetection is used. Returns \"undef\" when there is no message with the specified id.\n\nexample:\n\nmy $msg = $inbox{$msgid};\nif($inbox{$msgid}->isDummy)  ...\n\n$obj->FIRSTKEY()\nSee NEXTKEY().\n\n$obj->NEXTKEY($previous)\nFIRSTKEY() returns the first message-id/message pair from the folder, and NEXTKEY returns\nthe message-id/message pair for the next message, in the order in which the message is\nstored in the folder.\n\nMessages flagged for deletion will not be returned. See the Mail::Box::messages() method of\nthe folder type for more information about the folder message order.\n\nexample:\n\nforeach my $msgid (keys %inbox) ...\nforeach my $msg (values %inbox) ...\n\nwhile(my ($msgid, $msg) = each %inbox) {\n$msg->print unless $msg->isDeleted;\n}\n\n$obj->STORE(undef, $message)\nStore a message in the folder. The key must be \"undef\", because the message-id of the\nspecified message is taken. This is shown in the first example. However, as you see, it is a\nbit complicated to specify \"undef\", therefore the string \"undef\" is accepted as well.\n\nThe message may be converted into something which can be stored in the folder type which is\nat stake. The added instance is returned.\n\nexample:\n\n$inbox{ (undef) } = $msg;\n$inbox{undef} = $msg;\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "This module is part of Mail-Box distribution version 3.009, built on August 18, 2020. Website:\nhttp://perl.overmeer.net/CPAN/\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "Copyrights 2001-2020 by [Mark Overmeer]. For other contributors see ChangeLog.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself. See http://dev.perl.org/licenses/\n",
                "subsections": []
            }
        }
    }
}