{
    "content": [
        {
            "type": "text",
            "text": "# Filter::cpp (perldoc)\n\n## NAME\n\nFilter::cpp - cpp source filter\n\n## SYNOPSIS\n\nuse Filter::cpp ;\n\n## DESCRIPTION\n\nThis source filter pipes the current source file through the C pre-processor (cpp) if it is\navailable.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **AUTHOR**\n- **DATE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Filter::cpp",
        "section": "",
        "mode": "perldoc",
        "summary": "Filter::cpp - cpp source filter",
        "synopsis": "use Filter::cpp ;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 46,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DATE",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Filter::cpp - cpp source filter\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Filter::cpp ;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This source filter pipes the current source file through the C pre-processor (cpp) if it is\navailable.\n\nAs with all source filters its scope is limited to the current source file only. Every file you\nwant to be processed by the filter must have a\n\nuse Filter::cpp ;\n\nnear the top.\n\nHere is an example script which uses the filter:\n\nuse Filter::cpp ;\n\n#define FRED 1\n$a = 2 + FRED ;\nprint \"a = $a\\n\" ;\n#ifdef FRED\nprint \"Hello FRED\\n\" ;\n#else\nprint \"Where is FRED\\n\" ;\n#endif\n\nAnd here is what it will output:\n\na = 3\nHello FRED\n\nThis example below, provided by Michael G Schwern, shows a clever way to get Perl to use a C\npre-processor macro when the Filter::cpp module is available, or to use a Perl sub when it is\nnot.\n\n# use Filter::cpp if we can.\nBEGIN { eval 'use Filter::cpp' }\n\nsub PRINT {\nmy($string) = shift;\n\n#define PRINT($string) \\\n(print $string.\"\\n\")\n}\n\nPRINT(\"Mu\");\n\nLook at Michael's Tie::VecArray module for a practical use.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Paul Marquess\n",
                "subsections": []
            },
            "DATE": {
                "content": "11th December 1995.\n",
                "subsections": []
            }
        }
    }
}