{
    "mode": "perldoc",
    "parameter": "TAP::Parser::YAMLish::Writer",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/TAP%3A%3AParser%3A%3AYAMLish%3A%3AWriter/json",
    "generated": "2026-06-03T14:06:12Z",
    "synopsis": "use TAP::Parser::YAMLish::Writer;\nmy $data = {\none => 1,\ntwo => 2,\nthree => [ 1, 2, 3 ],\n};\nmy $yw = TAP::Parser::YAMLish::Writer->new;\n# Write to an array...\n$yw->write( $data, \\@somearray );\n# ...an open file handle...\n$yw->write( $data, $somefilehandle );\n# ...a string ...\n$yw->write( $data, \\$somestring );\n# ...or a closure\n$yw->write( $data, sub {\nmy $line = shift;\nprint \"$line\\n\";\n} );",
    "sections": {
        "NAME": {
            "content": "TAP::Parser::YAMLish::Writer - Write YAMLish data\n",
            "subsections": []
        },
        "VERSION": {
            "content": "Version 3.43\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use TAP::Parser::YAMLish::Writer;\n\nmy $data = {\none => 1,\ntwo => 2,\nthree => [ 1, 2, 3 ],\n};\n\nmy $yw = TAP::Parser::YAMLish::Writer->new;\n\n# Write to an array...\n$yw->write( $data, \\@somearray );\n\n# ...an open file handle...\n$yw->write( $data, $somefilehandle );\n\n# ...a string ...\n$yw->write( $data, \\$somestring );\n\n# ...or a closure\n$yw->write( $data, sub {\nmy $line = shift;\nprint \"$line\\n\";\n} );\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Encodes a scalar, hash reference or array reference as YAMLish.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "",
            "subsections": [
                {
                    "name": "Class Methods",
                    "content": "\"new\"\nmy $writer = TAP::Parser::YAMLish::Writer->new;\n\nThe constructor \"new\" creates and returns an empty \"TAP::Parser::YAMLish::Writer\" object.\n"
                },
                {
                    "name": "Instance Methods",
                    "content": "\"write\"\n$writer->write($obj, $output );\n\nEncode a scalar, hash reference or array reference as YAML.\n\nmy $writer = sub {\nmy $line = shift;\nprint SOMEFILE \"$line\\n\";\n};\n\nmy $data = {\none => 1,\ntwo => 2,\nthree => [ 1, 2, 3 ],\n};\n\nmy $yw = TAP::Parser::YAMLish::Writer->new;\n$yw->write( $data, $writer );\n\nThe $output argument may be:\n\n*   a reference to a scalar to append YAML to\n\n*   the handle of an open file\n\n*   a reference to an array into which YAML will be pushed\n\n*   a code reference\n\nIf you supply a code reference the subroutine will be called once for each line of output with\nthe line as its only argument. Passed lines will have no trailing newline.\n"
                }
            ]
        },
        "AUTHOR": {
            "content": "Andy Armstrong, <andy@hexten.net>\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "YAML::Tiny, YAML, YAML::Syck, Config::Tiny, CSS::Tiny,\n<http://use.perl.org/~Alias/journal/29427>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright 2007-2011 Andy Armstrong.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n\nThe full text of the license can be found in the LICENSE file included with this module.\n",
            "subsections": []
        }
    },
    "summary": "TAP::Parser::YAMLish::Writer - Write YAMLish data",
    "flags": [],
    "examples": [],
    "see_also": []
}