{
    "mode": "perldoc",
    "parameter": "more",
    "section": "-q",
    "url": "https://www.chedong.com/phpMan.php/perldoc/more/json",
    "generated": "2026-06-03T04:24:06Z",
    "sections": {
        "Found in /usr/share/perl/5.34/pod/perlfaq3.pod": {
            "content": "How can I make my CGI script more efficient?\nBeyond the normal measures described to make general Perl programs\nfaster or smaller, a CGI program has additional issues. It may be run\nseveral times per second. Given that each time it runs it will need to\nbe re-compiled and will often allocate a megabyte or more of system\nmemory, this can be a killer. Compiling into C isn't going to help you\nbecause the process start-up overhead is where the bottleneck is.\n\nThere are three popular ways to avoid this overhead. One solution\ninvolves running the Apache HTTP server (available from\n<http://www.apache.org/> ) with either of the modperl or modfastcgi\nplugin modules.\n\nWith modperl and the Apache::Registry module (distributed with\nmodperl), httpd will run with an embedded Perl interpreter which\npre-compiles your script and then executes it within the same address\nspace without forking. The Apache extension also gives Perl access to\nthe internal server API, so modules written in Perl can do just about\nanything a module written in C can. For more on modperl, see\n<http://perl.apache.org/>\n\nWith the FCGI module (from CPAN) and the modfastcgi module (available\nfrom <http://www.fastcgi.com/> ) each of your Perl programs becomes a\npermanent CGI daemon process.\n\nFinally, Plack is a Perl module and toolkit that contains PSGI\nmiddleware, helpers and adapters to web servers, allowing you to easily\ndeploy scripts which can continue running, and provides flexibility with\nregards to which web server you use. It can allow existing CGI scripts\nto enjoy this flexibility and performance with minimal changes, or can\nbe used along with modern Perl web frameworks to make writing and\ndeploying web services with Perl a breeze.\n\nThese solutions can have far-reaching effects on your system and on the\nway you write your CGI programs, so investigate them with care.\n\nSee also\n<http://www.cpan.org/modules/by-category/15WorldWideWebHTMLHTTPCGI\n/> .\n",
            "subsections": []
        },
        "Found in /usr/share/perl/5.34/pod/perlfaq5.pod": {
            "content": "How do I print to more than one file at once?\nTo connect one filehandle to several output filehandles, you can use the\nIO::Tee or Tie::FileHandle::Multiplex modules.\n\nIf you only have to do this once, you can print individually to each\nfilehandle.\n\nfor my $fh ($fh1, $fh2, $fh3) { print $fh \"whatever\\n\" }\n",
            "subsections": []
        },
        "Found in /usr/share/perl/5.34/pod/perlfaq6.pod": {
            "content": "I'm having trouble matching over more than one line. What's wrong?\nEither you don't have more than one line in the string you're looking at\n(probably), or else you aren't using the correct modifier(s) on your\npattern (possibly).\n\nThere are many ways to get multiline data into a string. If you want it\nto happen automatically while reading input, you'll want to set $/\n(probably to '' for paragraphs or \"undef\" for the whole file) to allow\nyou to read more than one line at a time.\n\nRead perlre to help you decide which of \"/s\" and \"/m\" (or both) you\nmight want to use: \"/s\" allows dot to include newline, and \"/m\" allows\ncaret and dollar to match next to a newline, not just at the end of the\nstring. You do need to make sure that you've actually got a multiline\nstring in there.\n\nFor example, this program detects duplicate words, even when they span\nline breaks (but not paragraph ones). For this example, we don't need\n\"/s\" because we aren't using dot in a regular expression that we want to\ncross line boundaries. Neither do we need \"/m\" because we don't want\ncaret or dollar to match at any point inside the record next to\nnewlines. But it's imperative that $/ be set to something other than the\ndefault, or else we won't actually ever have a multiline record read in.\n\n$/ = '';          # read in whole paragraph, not just one line\nwhile ( <> ) {\nwhile ( /\\b([\\w'-]+)(\\s+\\g1)+\\b/gi ) {     # word starts alpha\nprint \"Duplicate $1 at paragraph $.\\n\";\n}\n}\n\nHere's some code that finds sentences that begin with \"From \" (which\nwould be mangled by many mailers):\n\n$/ = '';          # read in whole paragraph, not just one line\nwhile ( <> ) {\nwhile ( /^From /gm ) { # /m makes ^ match next to \\n\nprint \"leading From in paragraph $.\\n\";\n}\n}\n\nHere's code that finds everything between START and END in a paragraph:\n\nundef $/;          # read in whole file, not just one line or paragraph\nwhile ( <> ) {\nwhile ( /START(.*?)END/sgm ) { # /s makes . cross line boundaries\nprint \"$1\\n\";\n}\n}\n",
            "subsections": []
        }
    },
    "flags": [],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Interactively display a file, allowing scrolling and searching.",
        "examples": [
            {
                "description": "Open a file",
                "command": "more {{path/to/file}}"
            },
            {
                "description": "Display a specific line",
                "command": "more +{{line_number}} {{path/to/file}}"
            },
            {
                "description": "Go to the next page",
                "command": "<Space>"
            },
            {
                "description": "Search for a string (press `<n>` to go to the next match)",
                "command": "</>{{something}}<Enter>"
            },
            {
                "description": "Exit",
                "command": "<q>"
            },
            {
                "description": "Display help about interactive commands",
                "command": "<h>"
            }
        ]
    }
}