{
    "mode": "perldoc",
    "parameter": "Text::Tabs",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Text%3A%3ATabs/json",
    "generated": "2026-06-10T23:25:51Z",
    "synopsis": "use Text::Tabs;\n$tabstop = 4;  # default = 8\n@lineswithouttabs = expand(@lineswithtabs);\n@lineswithtabs = unexpand(@lineswithouttabs);",
    "sections": {
        "NAME": {
            "content": "Text::Tabs - expand and unexpand tabs like unix expand(1) and unexpand(1)\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Text::Tabs;\n\n$tabstop = 4;  # default = 8\n@lineswithouttabs = expand(@lineswithtabs);\n@lineswithtabs = unexpand(@lineswithouttabs);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Text::Tabs does most of what the unix utilities expand(1) and unexpand(1) do. Given a line with\ntabs in it, \"expand\" replaces those tabs with the appropriate number of spaces. Given a line\nwith or without tabs in it, \"unexpand\" adds tabs when it can save bytes by doing so, like the\n\"unexpand -a\" command.\n\nUnlike the old unix utilities, this module correctly accounts for any Unicode combining\ncharacters (such as diacriticals) that may occur in each line for both expansion and\nunexpansion. These are overstrike characters that do not increment the logical position. Make\nsure you have the appropriate Unicode settings enabled.\n",
            "subsections": []
        },
        "EXPORTS": {
            "content": "The following are exported:\n\nexpand\nunexpand\n$tabstop\nThe $tabstop variable controls how many column positions apart each tabstop is. The default\nis 8.\n\nPlease note that \"local($tabstop)\" doesn't do the right thing and if you want to use \"local\"\nto override $tabstop, you need to use \"local($Text::Tabs::tabstop)\".\n",
            "subsections": []
        },
        "EXAMPLE": {
            "content": "#!perl\n# unexpand -a\nuse Text::Tabs;\n\nwhile (<>) {\nprint unexpand $;\n}\n\nInstead of the shell's \"expand\" command, use:\n\nperl -MText::Tabs -n -e 'print expand $'\n\nInstead of the shell's \"unexpand -a\" command, use:\n\nperl -MText::Tabs -n -e 'print unexpand $'\n",
            "subsections": []
        },
        "SUBVERSION": {
            "content": "This module comes in two flavors: one for modern perls (5.10 and above) and one for ancient\nobsolete perls. The version for modern perls has support for Unicode. The version for old perls\ndoes not. You can tell which version you have installed by looking at $Text::Tabs::SUBVERSION:\nit is \"old\" for obsolete perls and \"modern\" for current perls.\n\nThis man page is for the version for modern perls and so that's probably what you've got.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Text::Tabs handles only tabs (\"\\t\") and combining characters (\"/\\pM/\"). It doesn't count\nbackwards for backspaces (\"\\t\"), omit other non-printing control characters (\"/\\pC/\"), or\notherwise deal with any other zero-, half-, and full-width characters.\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "Copyright (C) 1996-2002,2005,2006 David Muir Sharnoff. Copyright (C) 2005 Aristotle Pagaltzis\nCopyright (C) 2012-2013 Google, Inc. This module may be modified, used, copied, and\nredistributed at your own risk. Although allowed by the preceding license, please do not\npublicly redistribute modified versions of this code with the name \"Text::Tabs\" unless it passes\nthe unmodified Text::Tabs test suite.\n",
            "subsections": []
        }
    },
    "summary": "Text::Tabs - expand and unexpand tabs like unix expand(1) and unexpand(1)",
    "flags": [],
    "examples": [
        "#!perl",
        "# unexpand -a",
        "use Text::Tabs;",
        "while (<>) {",
        "print unexpand $;",
        "Instead of the shell's \"expand\" command, use:",
        "perl -MText::Tabs -n -e 'print expand $'",
        "Instead of the shell's \"unexpand -a\" command, use:",
        "perl -MText::Tabs -n -e 'print unexpand $'"
    ],
    "see_also": []
}