{
    "mode": "perldoc",
    "parameter": "Mail::Message::Construct::Text",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AMessage%3A%3AConstruct%3A%3AText/json",
    "generated": "2026-07-05T09:32:15Z",
    "synopsis": "my $text = $msg->string;\nmy $text = \"$msg\";   # via overload\nmy @text = $msg->lines;\nmy @text = @$lines;  # via overload\nmy $fh   = $msg->file;\nmy $line = <$fh>;\n$msg->printStructure;",
    "sections": {
        "NAME": {
            "content": "Mail::Message::Construct::Text - capture a Mail::Message as text\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "my $text = $msg->string;\nmy $text = \"$msg\";   # via overload\n\nmy @text = $msg->lines;\nmy @text = @$lines;  # via overload\n\nmy $fh   = $msg->file;\nmy $line = <$fh>;\n\n$msg->printStructure;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Complex functionality on Mail::Message objects is implemented in different files which are\nautoloaded. This file implements the functionality related to creating message replies.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "",
            "subsections": [
                {
                    "name": "The whole message as text",
                    "content": "$obj->file()\nReturns the message as file-handle.\n\n$obj->lines()\nReturns the whole message as set of lines. In LIST context, copies of the lines are\nreturned. In SCALAR context, a reference to an array of lines is returned.\n\n$obj->printStructure( [$fh|undef],[$indent] )\nPrint the structure of a message to the specified $fh or the selected filehandle. When\nexplicitly \"undef\" is specified as handle, then the output will be returned as string.\n\nThe message's subject and the types of all composing parts are displayed.\n\n$indent specifies the initial indentation string: it is added in front of each line. The\n$indent must contain at least one white-space.\n\nexample:\n\nmy $msg = ...;\n$msg->printStructure(\\*OUTPUT);\n\n$msg->printStructure;\n\nmy $struct = $msg->printStructure(undef);\n\n# Possible output for one message:\nmultipart/mixed: forwarded message from Pietje Puk (1550 bytes)\ntext/plain (164 bytes)\nmessage/rfc822 (1043 bytes)\nmultipart/alternative: A multipart alternative (942 bytes)\ntext/plain (148 bytes, deleted)\ntext/html (358 bytes)\n\n$obj->string()\nReturns the whole message as string.\n"
                },
                {
                    "name": "Flags",
                    "content": ""
                }
            ]
        },
        "SEE ALSO": {
            "content": "This module is part of Mail-Message distribution version 3.012, built on February 11, 2022.\nWebsite: http://perl.overmeer.net/CPAN/\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "Copyrights 2001-2022 by [Mark Overmeer <markov@cpan.org>]. 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": []
        }
    },
    "summary": "Mail::Message::Construct::Text - capture a Mail::Message as text",
    "flags": [],
    "examples": [],
    "see_also": []
}