{
    "mode": "man",
    "parameter": "perlrun",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/perlrun/1/json",
    "generated": "2026-08-20T12:15:27Z",
    "synopsis": "perl [ -gsTtuUWX ]      [ -h?v ] [ -V[:configvar] ]\n[ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ]\n[ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/hexadecimal] ]\n[ -Idir ] [ -m[-]module ] [ -M[-]'module...' ] [ -f ]      [ -C [number/list] ]\n[ -S ]      [ -x[dir] ]      [ -i[extension] ]\n[ [-e|-E] 'command' ] [ -- ] [ programfile ] [ argument ]...",
    "sections": {
        "NAME": {
            "content": "perlrun - how to execute the Perl interpreter\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "perl [ -gsTtuUWX ]      [ -h?v ] [ -V[:configvar] ]\n[ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ]\n[ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/hexadecimal] ]\n[ -Idir ] [ -m[-]module ] [ -M[-]'module...' ] [ -f ]      [ -C [number/list] ]\n[ -S ]      [ -x[dir] ]      [ -i[extension] ]\n[ [-e|-E] 'command' ] [ -- ] [ programfile ] [ argument ]...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The normal way to run a Perl program is by making it directly executable, or else by passing\nthe name of the source file as an argument on the command line.  (An interactive Perl\nenvironment is also possible--see perldebug for details on how to do that.)  Upon startup,\nPerl looks for your program in one of the following places:\n\n1.  Specified line by line via -e or -E switches on the command line.\n\n2.  Contained  in  the  file specified by the first filename on the command line.  (Note that\nsystems supporting the \"#!\" notation invoke  interpreters  this  way.  See  \"Location  of\nPerl\".)\n\n3.  Passed  in  implicitly  via  standard  input.   This  works only if there are no filename\narguments--to pass arguments to a STDIN-read program you must explicitly  specify  a  \"-\"\nfor the program name.\n\nWith  methods  2  and 3, Perl starts parsing the input file from the beginning, unless you've\nspecified a \"-x\" switch, in which case it scans for the first line  starting  with  \"#!\"  and\ncontaining  the  word \"perl\", and starts there instead.  This is useful for running a program\nembedded in a larger message.  (In this case you would indicate the end of the program  using\nthe \"END\" token.)\n\nThe  \"#!\"  line is always examined for switches as the line is being parsed.  Thus, if you're\non a machine that allows only one argument  with  the  \"#!\"  line,  or  worse,  doesn't  even\nrecognize the \"#!\" line, you still can get consistent switch behaviour regardless of how Perl\nwas invoked, even if \"-x\" was used to find the beginning of the program.\n\nBecause historically some operating systems silently chopped off kernel interpretation of the\n\"#!\"  line  after 32 characters, some switches may be passed in on the command line, and some\nmay not; you could even get a \"-\" without its letter, if you're not  careful.   You  probably\nwant  to  make  sure  that  all  your  switches fall either before or after that 32-character\nboundary.  Most switches don't actually care if they're processed redundantly, but getting  a\n\"-\" instead of a complete switch could cause Perl to try to execute standard input instead of\nyour program.  And a partial -I switch could also cause odd results.\n\nSome  switches  do  care if they are processed twice, for instance combinations of -l and -0.\nEither put all the switches after the 32-character boundary (if applicable), or  replace  the\nuse of -0digits by \"BEGIN{ $/ = \"\\0digits\"; }\".\n\nParsing  of the \"#!\" switches starts wherever \"perl\" is mentioned in the line.  The sequences\n\"-*\" and \"- \" are specifically ignored so that you could, if you were so inclined, say\n\n#!/bin/sh\n#! -*- perl -*- -p\neval 'exec perl -x -wS $0 ${1+\"$@\"}'\nif 0;\n\nto let Perl see the \"-p\" switch.\n\nA similar trick involves the env program, if you have it.\n\n#!/usr/bin/env perl\n\nThe examples above use a relative path to the perl interpreter, getting whatever  version  is\nfirst  in  the  user's  path.   If  you want a specific version of Perl, say, perl5.14.1, you\nshould place that directly in the \"#!\" line's path.\n\nIf the \"#!\" line does not contain the word \"perl\" nor the word  \"indir\",  the  program  named\nafter the \"#!\" is executed instead of the Perl interpreter.  This is slightly bizarre, but it\nhelps people on machines that don't do \"#!\", because they can tell a program that their SHELL\nis  /usr/bin/perl,  and  Perl  will  then dispatch the program to the correct interpreter for\nthem.\n\nAfter locating your program, Perl compiles the entire program to an internal form.  If  there\nare  any  compilation errors, execution of the program is not attempted.  (This is unlike the\ntypical shell script, which might run part-way through before finding a syntax error.)\n\nIf the program is syntactically correct, it is executed.  If the program  runs  off  the  end\nwithout  hitting  an  exit()  or  die() operator, an implicit exit(0) is provided to indicate\nsuccessful completion.\n",
            "subsections": [
                {
                    "name": "#! and quoting on non-Unix systems",
                    "content": "Unix's \"#!\" technique can be simulated on other systems:\n\nOS/2\nPut\n\nextproc perl -S -yourswitches\n\nas the first line in \"*.cmd\" file (\"-S\" due to a bug in cmd.exe's `extproc' handling).\n\nMS-DOS\nCreate a batch file to run your program, and codify it in  \"ALTERNATESHEBANG\"  (see  the\ndosish.h file in the source distribution for more information).\n\nWin95/NT\nThe Win95/NT installation, when using the ActiveState installer for Perl, will modify the\nRegistry  to  associate the .pl extension with the perl interpreter.  If you install Perl\nby other means (including building from the sources), you may have to modify the Registry\nyourself.  Note that this means  you  can  no  longer  tell  the  difference  between  an\nexecutable Perl program and a Perl library file.\n\nVMS Put\n\n$ perl -mysw 'f$env(\"procedure\")' 'p1' 'p2' 'p3' 'p4' 'p5' 'p6' 'p7' 'p8' !\n$ exit++ + ++$status != 0 and $exit = $status = undef;\n\nat the top of your program, where -mysw are any command line switches you want to pass to\nPerl.   You  can  now  invoke the program directly, by saying \"perl program\", or as a DCL\nprocedure, by saying @program (or implicitly via DCL$PATH by just using the name  of  the\nprogram).\n\nThis  incantation  is a bit much to remember, but Perl will display it for you if you say\n\"perl \"-V:startperl\"\".\n\nCommand-interpreters on non-Unix systems have rather different ideas  on  quoting  than  Unix\nshells.   You'll  need  to learn the special characters in your command-interpreter (\"*\", \"\\\"\nand \"\"\" are common) and how to protect whitespace and these characters to run one-liners (see\n-e below).\n\nOn some systems, you may have to change single-quotes to double ones, which you must  not  do\non Unix or Plan 9 systems.  You might also have to change a single % to a %%.\n\nFor example:\n\n# Unix\nperl -e 'print \"Hello world\\n\"'\n\n# MS-DOS, etc.\nperl -e \"print \\\"Hello world\\n\\\"\"\n\n# VMS\nperl -e \"print \"\"Hello world\\n\"\"\"\n\nThe  problem  is  that none of this is reliable: it depends on the command and it is entirely\npossible neither works.  If 4DOS were the command shell, this would probably work better:\n\nperl -e \"print <Ctrl-x>\"Hello world\\n<Ctrl-x>\"\"\n\nCMD.EXE in Windows NT slipped a lot  of  standard  Unix  functionality  in  when  nobody  was\nlooking, but just try to find documentation for its quoting rules.\n\nThere is no general solution to all of this.  It's just a mess.\n"
                },
                {
                    "name": "Location of Perl",
                    "content": "It  may  seem  obvious  to  say, but Perl is useful only when users can easily find it.  When\npossible, it's good for both /usr/bin/perl and /usr/local/bin/perl  to  be  symlinks  to  the\nactual  binary.   If that can't be done, system administrators are strongly encouraged to put\n(symlinks to) perl and its accompanying utilities into a directory typically  found  along  a\nuser's PATH, or in some other obvious and convenient place.\n\nIn  this  documentation, \"#!/usr/bin/perl\" on the first line of the program will stand in for\nwhatever method works on your system.  You are advised to use a specific  path  if  you  care\nabout a specific version.\n\n#!/usr/local/bin/perl5.14\n\nor if you just want to be running at least version, place a statement like this at the top of\nyour program:\n\nuse v5.14;\n"
                },
                {
                    "name": "Command Switches",
                    "content": "As  with all standard commands, a single-character switch may be clustered with the following\nswitch, if any.\n\n#!/usr/bin/perl -spi.orig   # same as -s -p -i.orig\n\nA \"--\" signals the end of options and disables further option processing. Any arguments after\nthe \"--\" are treated as filenames and arguments.\n\nSwitches include:\n"
                },
                {
                    "name": "-0",
                    "content": "specifies the input record separator ($/) as an octal or hexadecimal number.   If  there\nare  no  digits,  the  null  character  is the separator.  Other switches may precede or\nfollow the digits.  For example, if you have a version of find which can print filenames\nterminated by the null character, you can say this:\n\nfind . -name '*.orig' -print0 | perl -n0e unlink\n\nThe special value 00 will cause Perl to slurp files in paragraph mode.\n\nAny value 0400 or above will cause Perl to slurp files  whole,  but  by  convention  the\nvalue  0777  is the one normally used for this purpose. The \"-g\" flag is a simpler alias\nfor it.\n\nYou can also specify the separator  character  using  hexadecimal  notation:  -0xHHH...,\nwhere the \"H\" are valid hexadecimal digits.  Unlike the octal form, this one may be used\nto  specify  any  Unicode  character,  even  those beyond 0xFF.  So if you really want a\nrecord separator of 0777, specify it as -0x1FF.  (This means that  you  cannot  use  the\n\"-x\" option with a directory name that consists of hexadecimal digits, or else Perl will\nthink you have specified a hex number to -0.)\n",
                    "flag": "-0"
                },
                {
                    "name": "-a",
                    "content": "@F  array is done as the first thing inside the implicit while loop produced by the \"-n\"\nor \"-p\".\n\nperl -ane 'print pop(@F), \"\\n\";'\n\nis equivalent to\n\nwhile (<>) {\n@F = split(' ');\nprint pop(@F), \"\\n\";\n}\n\nAn alternate delimiter may be specified using -F.\n\n-a implicitly sets \"-n\".\n",
                    "flag": "-a"
                },
                {
                    "name": "-C [_number/list_]",
                    "content": "The -C flag controls some of the Perl Unicode features.\n\nAs of 5.8.1, the -C can be followed either by a number or a list of option letters.  The\nletters, their numeric values, and effects are as follows; listing the letters is  equal\nto summing the numbers.\n\nI     1   STDIN is assumed to be in UTF-8\nO     2   STDOUT will be in UTF-8\nE     4   STDERR will be in UTF-8\nS     7   I + O + E\ni     8   UTF-8 is the default PerlIO layer for input streams\no    16   UTF-8 is the default PerlIO layer for output streams\nD    24   i + o\nA    32   the @ARGV elements are expected to be strings encoded\nin UTF-8\nL    64   normally the \"IOEioA\" are unconditional, the L makes\nthem conditional on the locale environment variables\n(the LCALL, LCCTYPE, and LANG, in the order of\ndecreasing precedence) -- if the variables indicate\nUTF-8, then the selected \"IOEioA\" are in effect\na   256   Set ${^UTF8CACHE} to -1, to run the UTF-8 caching\ncode in debugging mode.\n\nFor  example,  -COE  and  -C6  will  both  turn on UTF-8-ness on both STDOUT and STDERR.\nRepeating letters is just redundant, not cumulative nor toggling.\n\nThe \"io\" options mean that any subsequent open() (or similar  I/O  operations)  in  main\nprogram  scope  will  have the \":utf8\" PerlIO layer implicitly applied to them, in other\nwords, UTF-8 is expected from any input stream, and UTF-8  is  produced  to  any  output\nstream.  This is just the default set via \"${^OPEN}\", with explicit layers in open() and\nwith  binmode()  one can manipulate streams as usual.  This has no effect on code run in\nmodules.\n\n-C on its own (not followed by any number or option list), or the empty  string  \"\"  for\nthe  \"PERLUNICODE\" environment variable, has the same effect as -CSDL.  In other words,\nthe standard I/O handles and the default open() layer are UTF-8-fied  but  only  if  the\nlocale  environment  variables  indicate  a  UTF-8  locale.   This behaviour follows the\nimplicit (and problematic) UTF-8 behaviour of Perl 5.8.0.  (See \"UTF-8 no longer default\nunder UTF-8 locales\" in perl581delta.)\n\nYou can use -C0 (or \"0\" for \"PERLUNICODE\") to explicitly disable all the above  Unicode\nfeatures.\n\nThe  read-only  magic variable \"${^UNICODE}\" reflects the numeric value of this setting.\nThis variable is set during Perl startup and  is  thereafter  read-only.   If  you  want\nruntime  effects,  use  the  three-arg  open()  (see  \"open\"  in  perlfunc), the two-arg\nbinmode() (see \"binmode\" in perlfunc), and the \"open\" pragma (see open).\n\n(In Perls earlier than 5.8.1 the -C switch was a Win32-only switch that enabled the  use\nof  Unicode-aware  \"wide  system call\" Win32 APIs.  This feature was practically unused,\nhowever, and the command line switch was therefore \"recycled\".)\n\nNote: Since perl 5.10.1, if the -C option is used on the \"#!\" line, it must be specified\non the command line as well, since the standard streams are already set up at this point\nin the execution of the perl interpreter.   You  can  also  use  binmode()  to  set  the\nencoding of an I/O stream.\n",
                    "flag": "-C",
                    "arg": "[_number/list_]"
                },
                {
                    "name": "-c",
                    "content": "Actually, it will execute any \"BEGIN\", \"UNITCHECK\", or  \"CHECK\"  blocks  and  any  \"use\"\nstatements:  these  are  considered  as occurring outside the execution of your program.\n\"INIT\" and \"END\" blocks, however, will be skipped.\n",
                    "flag": "-c"
                },
                {
                    "name": "-d",
                    "content": "",
                    "flag": "-d"
                },
                {
                    "name": "-dt",
                    "content": "indicates to the debugger that threads will be used in the code being debugged.\n"
                },
                {
                    "name": "-d:_",
                    "content": ""
                },
                {
                    "name": "-dt:_",
                    "content": "runs  the  program  under  the  control  of  a  debugging,  profiling, or tracing module\ninstalled as \"Devel::MOD\". E.g., -d:DProf executes the program using the  \"Devel::DProf\"\nprofiler.   As with the -M flag, options may be passed to the \"Devel::MOD\" package where\nthey will be received and interpreted by the \"Devel::MOD::import\" routine.  Again,  like\n-M,  use --d:-MOD to call \"Devel::MOD::unimport\" instead of import.  The comma-separated\nlist of options must follow a \"=\" character.  If t is specified,  it  indicates  to  the\ndebugger that threads will be used in the code being debugged.  See perldebug.\n"
                },
                {
                    "name": "-D_",
                    "content": ""
                },
                {
                    "name": "-D_",
                    "content": "sets  debugging  flags.  This  switch is enabled only if your perl binary has been built\nwith debugging enabled: normal production perls won't have been.\n\nFor example, to watch how perl executes your program, use -Dtls.  Another nice value  is\n-Dx,  which  lists  your  compiled  syntax  tree,  and  -Dr  displays  compiled  regular\nexpressions; the format of the output is explained in perldebguts.\n\nAs an alternative, specify a number instead of list of letters (e.g., -D14 is equivalent\nto -Dtls):\n\n1  p  Tokenizing and parsing (with v, displays parse\nstack)\n2  s  Stack snapshots (with v, displays all stacks)\n4  l  Context (loop) stack processing\n8  t  Trace execution\n16  o  Method and overloading resolution\n32  c  String/numeric conversions\n64  P  Print profiling info, source file input state\n128  m  Memory and SV allocation\n256  f  Format processing\n512  r  Regular expression parsing and execution\n1024  x  Syntax tree dump\n2048  u  Tainting checks\n4096  U  Unofficial, User hacking (reserved for private,\nunreleased use)\n8192  h  Show hash randomization debug output (changes to\nPLhashrandbits and their origin)\n16384  X  Scratchpad allocation\n32768  D  Cleaning up\n65536  S  Op slab allocation\n131072  T  Tokenizing\n262144  R  Include reference counts of dumped variables\n(eg when using -Ds)\n524288  J  show s,t,P-debug (don't Jump over) on opcodes within\npackage DB\n1048576  v  Verbose: use in conjunction with other flags to\nincrease the verbosity of the output.  Is a no-op on\nmany of the other flags\n2097152  C  Copy On Write\n4194304  A  Consistency checks on internal structures\n8388608  q  quiet - currently only suppresses the \"EXECUTING\"\nmessage\n16777216  M  trace smart match resolution\n33554432  B  dump suBroutine definitions, including special\nBlocks like BEGIN\n67108864  L  trace Locale-related info; what gets output is very\nsubject to change\n134217728  i  trace PerlIO layer processing.  Set PERLIODEBUG to\nthe filename to trace to.\n268435456  y  trace y///, tr/// compilation and execution\n\nAll these flags require -DDEBUGGING when you compile the Perl executable (but see \":opd\"\nin Devel::Peek or \"'debug' mode\" in re which may change this).  See the INSTALL file  in\nthe Perl source distribution for how to do this.\n\nIf  you're  just trying to get a print out of each line of Perl code as it executes, the\nway that \"sh -x\" provides for shell scripts, you can't use Perl's -D switch.  Instead do\nthis\n\n# If you have \"env\" utility\nenv PERLDBOPTS=\"NonStop=1 AutoTrace=1 frame=2\" perl -dS program\n\n# Bourne shell syntax\n$ PERLDBOPTS=\"NonStop=1 AutoTrace=1 frame=2\" perl -dS program\n\n# csh syntax\n% (setenv PERLDBOPTS \"NonStop=1 AutoTrace=1 frame=2\"; perl -dS program)\n\nSee perldebug for details and variations.\n"
                },
                {
                    "name": "-e _",
                    "content": "may be used to enter one line of program.  If -e is given, Perl  will  not  look  for  a\nfilename  in  the argument list.  Multiple -e commands may be given to build up a multi-\nline script.  Make sure to use semicolons where you would in a normal program.\n",
                    "flag": "-e"
                },
                {
                    "name": "-E _",
                    "content": "behaves just like -e, except that it implicitly enables all optional  features  (in  the\nmain compilation unit). See feature.\n",
                    "flag": "-E"
                },
                {
                    "name": "-f",
                    "content": "Perl    can    be    built    so    that   it   by   default   will   try   to   execute\n$Config{sitelib}/sitecustomize.pl at startup (in a BEGIN block).  This is  a  hook  that\nallows  the  sysadmin to customize how Perl behaves.  It can for instance be used to add\nentries to the @INC array to make Perl find modules in non-standard locations.\n\nPerl actually inserts the following code:\n\nBEGIN {\ndo { local $!; -f \"$Config{sitelib}/sitecustomize.pl\"; }\n&& do \"$Config{sitelib}/sitecustomize.pl\";\n}\n\nSince it is an actual \"do\" (not a \"require\"), sitecustomize.pl doesn't need to return  a\ntrue value. The code is run in package \"main\", in its own lexical scope. However, if the\nscript dies, $@ will not be set.\n\nThe  value  of  $Config{sitelib}  is  also  determined  in  C  code  and  not  read from\n\"Config.pm\", which is not loaded.\n\nThe code is executed very early. For example, any changes made to @INC will show  up  in\nthe output of `perl -V`. Of course, \"END\" blocks will be likewise executed very late.\n\nTo determine at runtime if this capability has been compiled in your perl, you can check\nthe value of $Config{usesitecustomize}.\n",
                    "flag": "-f"
                },
                {
                    "name": "-F_",
                    "content": "specifies  the  pattern to split on for \"-a\". The pattern may be surrounded by \"//\", \"\",\nor '', otherwise it will be put in single quotes. You can't use  literal  whitespace  or\nNUL characters in the pattern.\n\n-F implicitly sets both \"-a\" and \"-n\".\n"
                },
                {
                    "name": "-g",
                    "content": "words, it causes Perl to read whole files at once, instead of line by line.\n\nThis flag is a simpler alias for -0777.\n\nMnemonics: gobble, grab, gulp.\n",
                    "flag": "-g"
                },
                {
                    "name": "-h",
                    "content": "-?   synonym for -h: prints a summary of the options.\n",
                    "flag": "-h"
                },
                {
                    "name": "-i",
                    "content": "specifies that files processed by the \"<>\" construct are to be edited in-place.  It does\nthis by renaming the input file, opening the output  file  by  the  original  name,  and\nselecting  that  output  file  as the default for print() statements.  The extension, if\nsupplied, is used to modify the name of the old file to make a  backup  copy,  following\nthese rules:\n\nIf no extension is supplied, and your system supports it, the original file is kept open\nwithout  a name while the output is redirected to a new file with the original filename.\nWhen perl exits, cleanly or not, the original file is unlinked.\n\nIf the extension doesn't contain a \"*\", then it is appended to the end  of  the  current\nfilename  as  a  suffix.  If the extension does contain one or more \"*\" characters, then\neach \"*\" is replaced with the current filename.  In Perl terms, you could think of  this\nas:\n\n($backup = $extension) =~ s/\\*/$filename/g;\n\nThis  allows  you  to  add a prefix to the backup file, instead of (or in addition to) a\nsuffix:\n\n$ perl -pi'orig*' -e 's/bar/baz/' fileA  # backup to\n# 'origfileA'\n\nOr even to place backup copies of the original files into  another  directory  (provided\nthe directory already exists):\n\n$ perl -pi'old/*.orig' -e 's/bar/baz/' fileA  # backup to\n# 'old/fileA.orig'\n\nThese sets of one-liners are equivalent:\n\n$ perl -pi -e 's/bar/baz/' fileA          # overwrite current file\n$ perl -pi'*' -e 's/bar/baz/' fileA       # overwrite current file\n\n$ perl -pi'.orig' -e 's/bar/baz/' fileA   # backup to 'fileA.orig'\n$ perl -pi'*.orig' -e 's/bar/baz/' fileA  # backup to 'fileA.orig'\n\nFrom the shell, saying\n\n$ perl -p -i.orig -e \"s/foo/bar/; ... \"\n\nis the same as using the program:\n\n#!/usr/bin/perl -pi.orig\ns/foo/bar/;\n\nwhich is equivalent to\n\n#!/usr/bin/perl\n$extension = '.orig';\nLINE: while (<>) {\nif ($ARGV ne $oldargv) {\nif ($extension !~ /\\*/) {\n$backup = $ARGV . $extension;\n}\nelse {\n($backup = $extension) =~ s/\\*/$ARGV/g;\n}\nrename($ARGV, $backup);\nopen(ARGVOUT, \">$ARGV\");\nselect(ARGVOUT);\n$oldargv = $ARGV;\n}\ns/foo/bar/;\n}\ncontinue {\nprint;  # this prints to original filename\n}\nselect(STDOUT);\n\nexcept  that  the  -i  form  doesn't  need to compare $ARGV to $oldargv to know when the\nfilename has changed.  It does, however, use ARGVOUT for the selected filehandle.   Note\nthat STDOUT is restored as the default output filehandle after the loop.\n\nAs  shown  above,  Perl  creates  the  backup file whether or not any output is actually\nchanged.  So this is just a fancy way to copy files:\n\n$ perl -p -i'/some/file/path/*' -e 1 file1 file2 file3...\nor\n$ perl -p -i'.orig' -e 1 file1 file2 file3...\n\nYou can use \"eof\" without parentheses to locate the end of each input file, in case  you\nwant to append to each file, or reset line numbering (see example in \"eof\" in perlfunc).\n\nIf,  for  a  given  file,  Perl  is unable to create the backup file as specified in the\nextension then it will skip that file and continue on with the next one (if it exists).\n\nFor a discussion of issues surrounding file permissions and -i, see \"Why does  Perl  let\nme  delete  read-only  files?  Why does -i clobber protected files?  Isn't this a bug in\nPerl?\" in perlfaq5.\n\nYou cannot use -i to create directories or to strip extensions from files.\n\nPerl does not expand \"~\" in filenames, which is good, since some folks use it for  their\nbackup files:\n\n$ perl -pi~ -e 's/foo/bar/' file1 file2 file3...\n\nNote  that because -i renames or deletes the original file before creating a new file of\nthe same name, Unix-style soft and hard links will not be preserved.\n\nFinally, the -i switch does not impede execution when no files are given on the  command\nline.   In  this  case,  no  backup  is  made  (the  original file cannot, of course, be\ndetermined) and processing proceeds from STDIN to STDOUT as might be expected.\n",
                    "flag": "-i"
                },
                {
                    "name": "-I_",
                    "content": "Directories specified by -I are prepended to the search path for modules (@INC).\n"
                },
                {
                    "name": "-l",
                    "content": "enables automatic line-ending processing.  It  has  two  separate  effects.   First,  it\nautomatically  chomps  $/  (the  input  record  separator)  when used with \"-n\" or \"-p\".\nSecond, it assigns \"$\\\" (the output record separator) to have the  value  of  octnum  so\nthat any print statements will have that separator added back on.  If octnum is omitted,\nsets \"$\\\" to the current value of $/.  For instance, to trim lines to 80 columns:\n\nperl -lpe 'substr($, 80) = \"\"'\n\nNote  that  the  assignment \"$\\ = $/\" is done when the switch is processed, so the input\nrecord separator can be different than the output record separator if the -l  switch  is\nfollowed by a -0 switch:\n\ngnufind / -print0 | perl -ln0e 'print \"found $\" if -p'\n\nThis sets \"$\\\" to newline and then sets $/ to the null character.\n",
                    "flag": "-l"
                },
                {
                    "name": "-m -",
                    "content": "",
                    "flag": "-m"
                },
                {
                    "name": "-M -",
                    "content": "",
                    "flag": "-M"
                },
                {
                    "name": "-M -",
                    "content": "-[mM][-]module=arg[,arg]...\n-mmodule  executes  \"use\"  module  \"();\"  before executing your program.  This loads the\nmodule, but does not call its \"import\" method, so does not import subroutines  and  does\nnot give effect to a pragma.\n\n-Mmodule executes \"use\" module \";\" before executing your program.  This loads the module\nand  calls its \"import\" method, causing the module to have its default effect, typically\nimporting subroutines or giving effect to a pragma.  You can use  quotes  to  add  extra\ncode after the module name, e.g., '-MMODULE qw(foo bar)'.\n\nIf  the first character after the -M or -m is a dash (-) then the 'use' is replaced with\n'no'.  This makes no difference for -m.\n\nA  little  builtin  syntactic  sugar  means  you  can  also  say   -mMODULE=foo,bar   or\n-MMODULE=foo,bar  as a shortcut for '-MMODULE qw(foo bar)'.  This avoids the need to use\nquotes when importing symbols.  The actual code generated by  -MMODULE=foo,bar  is  \"use\nmodule  split(/,/,q{foo,bar})\".   Note that the \"=\" form removes the distinction between\n-m and -M; that is, -mMODULE=foo,bar is the same as -MMODULE=foo,bar.\n\nA consequence of the \"split\" formulation is that -MMODULE=number never  does  a  version\ncheck,  unless  \"MODULE::import()\"  itself  is set up to do a version check, which could\nhappen for example if MODULE inherits from Exporter.\n",
                    "flag": "-M"
                },
                {
                    "name": "-n",
                    "content": "over filename arguments somewhat like sed -n or awk:\n\nLINE:\nwhile (<>) {\n...             # your program goes here\n}\n\nNote  that  the lines are not printed by default.  See \"-p\" to have lines printed.  If a\nfile named by an argument cannot be opened for some reason, Perl warns you about it  and\nmoves on to the next file.\n\nAlso  note  that \"<>\" passes command line arguments to \"open\" in perlfunc, which doesn't\nnecessarily  interpret  them  as  file  names.   See   perlop  for   possible   security\nimplications.\n\nHere  is  an efficient way to delete all files that haven't been modified for at least a\nweek:\n\nfind . -mtime +7 -print | perl -nle unlink\n\nThis is faster than using the -exec switch of find because you don't  have  to  start  a\nprocess  on  every  filename  found  (but  it's not faster than using the -delete switch\navailable in newer versions of find.   It  does  suffer  from  the  bug  of  mishandling\nnewlines in pathnames, which you can fix if you follow the example under -0.\n\n\"BEGIN\"  and  \"END\"  blocks  may be used to capture control before or after the implicit\nprogram loop, just as in awk.\n",
                    "flag": "-n"
                },
                {
                    "name": "-p",
                    "content": "over filename arguments somewhat like sed:\n\nLINE:\nwhile (<>) {\n...             # your program goes here\n} continue {\nprint or die \"-p destination: $!\\n\";\n}\n\nIf  a  file  named by an argument cannot be opened for some reason, Perl warns you about\nit, and moves on to the next file.  Note that the lines are printed  automatically.   An\nerror  occurring during printing is treated as fatal.  To suppress printing use the \"-n\"\nswitch.  A -p overrides a -n switch.\n\n\"BEGIN\" and \"END\" blocks may be used to capture control before  or  after  the  implicit\nloop, just as in awk.\n",
                    "flag": "-p"
                },
                {
                    "name": "-s",
                    "content": "name but before any filename arguments (or before an argument of --).  Any switch  found\nthere  is removed from @ARGV and sets the corresponding variable in the Perl program, in\nthe main package.  The following program prints \"1\" if the program  is  invoked  with  a\n-xyz switch, and \"abc\" if it is invoked with -xyz=abc.\n\n#!/usr/bin/perl -s\nif ($xyz) { print \"$xyz\\n\" }\n\nDo  note  that  a  switch  like  --help  creates  the  variable \"${-help}\", which is not\ncompliant with \"use strict \"refs\"\".  Also, when using  this  option  on  a  script  with\nwarnings  enabled  you  may  get  a lot of spurious \"used only once\" warnings. For these\nreasons, use of -s is discouraged.  See  Getopt::Long  for  much  more  flexible  switch\nparsing.\n",
                    "flag": "-s"
                },
                {
                    "name": "-S",
                    "content": "of the program contains path separators.\n\nOn  some platforms, this also makes Perl append suffixes to the filename while searching\nfor it.  For example, on Win32 platforms, the \".bat\" and \".cmd\" suffixes are appended if\na lookup for the original name fails, and if the name does not already  end  in  one  of\nthose  suffixes.   If  your  Perl was compiled with \"DEBUGGING\" turned on, using the -Dp\nswitch to Perl shows how the search progresses.\n\nTypically this is used to emulate \"#!\" startup on platforms  that  don't  support  \"#!\".\nIt's  also convenient when debugging a script that uses \"#!\", and is thus normally found\nby the shell's $PATH search mechanism.\n\nThis example works on many platforms that have a shell compatible with Bourne shell:\n\n#!/usr/bin/perl\neval 'exec /usr/bin/perl -wS $0 ${1+\"$@\"}'\nif 0; # ^ Run only under a shell\n\nThe system ignores the first line and feeds the program to /bin/sh,  which  proceeds  to\ntry  to  execute the Perl program as a shell script.  The shell executes the second line\nas a normal shell command, and thus starts up the Perl interpreter.  On some systems  $0\ndoesn't  always  contain  the  full  pathname,  so the \"-S\" tells Perl to search for the\nprogram if necessary.  After Perl locates the program, it parses the lines  and  ignores\nthem because the check 'if 0' is never true.  If the program will be interpreted by csh,\nyou  will  need  to  replace  \"${1+\"$@\"}\"  with  $*, even though that doesn't understand\nembedded spaces (and such) in the argument list.  To start up sh rather than  csh,  some\nsystems  may  have  to  replace the \"#!\" line with a line containing just a colon, which\nwill be politely ignored by Perl.  Other systems can't control that, and need a  totally\ndevious construct that will work under any of csh, sh, or Perl, such as the following:\n\neval '(exit $?0)' && eval 'exec perl -wS $0 ${1+\"$@\"}'\n& eval 'exec /usr/bin/perl -wS $0 $argv:q'\nif 0; # ^ Run only under a shell\n\nIf  the  filename  supplied  contains  directory  separators  (and  so is an absolute or\nrelative pathname), and if that file is not found, platforms that append file extensions\nwill do so and try to look for the file with those extensions added, one by one.\n\nOn DOS-like platforms, if the program does not contain  directory  separators,  it  will\nfirst  be  searched  for in the current directory before being searched for on the PATH.\nOn Unix platforms, the program will be searched for strictly on the PATH.\n",
                    "flag": "-S"
                },
                {
                    "name": "-t",
                    "content": "warnings can now be controlled normally with no warnings qw(taint).\n\nNote:  This  is  not a substitute for \"-T\"! This is meant to be used only as a temporary\ndevelopment aid while securing legacy code: for real production code and for new  secure\ncode written from scratch, always use the real \"-T\".\n\nThis has no effect if your perl was built without taint support.\n",
                    "flag": "-t"
                },
                {
                    "name": "-T",
                    "content": "running setuid or setgid.  It's a good idea to turn them on explicitly for programs that\nrun on behalf of someone else whom you might not necessarily trust, such as CGI programs\nor any internet servers you might write in Perl.  See perlsec for details.  For security\nreasons, this option must be seen by Perl quite early; usually this means it must appear\nearly on the command line or in the \"#!\" line for systems which support that construct.\n",
                    "flag": "-T"
                },
                {
                    "name": "-u",
                    "content": "theory  take  this  core  dump  and  turn it into an executable file by using the undump\nprogram (not supplied).  This speeds startup at the expense of some  disk  space  (which\nyou can minimize by stripping the executable).  (Still, a \"hello world\" executable comes\nout  to  about  200K  on  my machine.)  If you want to execute a portion of your program\nbefore dumping, use the CORE::dump() function instead.  Note: availability of undump  is\nplatform specific and may not be available for a specific port of Perl.\n",
                    "flag": "-u"
                },
                {
                    "name": "-U",
                    "content": "attempting to unlink directories while running as superuser and running setuid  programs\nwith  fatal taint checks turned into warnings.  Note that warnings must be enabled along\nwith this option to actually generate the taint-check warnings.\n",
                    "flag": "-U"
                },
                {
                    "name": "-v",
                    "content": "",
                    "flag": "-v"
                },
                {
                    "name": "-V",
                    "content": "",
                    "flag": "-V"
                },
                {
                    "name": "-V:_",
                    "content": "Prints to STDOUT the value of the named configuration variable(s), with  multiples  when\nyour \"configvar\" argument looks like a regex (has non-letters).  For example:\n\n$ perl -V:libc\nlibc='/lib/libc-2.2.4.so';\n$ perl -V:lib.\nlibs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc';\nlibc='/lib/libc-2.2.4.so';\n$ perl -V:lib.*\nlibpth='/usr/local/lib /lib /usr/lib';\nlibs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc';\nlibext='.a';\nlibc='/lib/libc-2.2.4.so';\nlibperl='libperl.a';\n....\n\nAdditionally,  extra  colons  can  be  used  to  control  formatting.   A trailing colon\nsuppresses the linefeed and terminator \";\", allowing you to  embed  queries  into  shell\ncommands.  (mnemonic: PATH separator \":\".)\n\n$ echo \"compression-vars: \" `perl -V:z.*: ` \" are here !\"\ncompression-vars:  zcat='' zip='zip'  are here !\n\nA  leading colon removes the \"name=\" part of the response, this allows you to map to the\nname you need.  (mnemonic: empty label)\n\n$ echo \"goodvfork=\"`./perl -Ilib -V::usevfork`\ngoodvfork=false;\n\nLeading and trailing colons can be used together if you need positional parameter values\nwithout the names.  Note that in the case below, the \"PERLAPI\" params are  returned  in\nalphabetical order.\n\n$ echo buildingon `perl -V::osname: -V::PERLAPI.*:` now\nbuildingon 'linux' '5' '1' '9' now\n"
                },
                {
                    "name": "-w",
                    "content": "scalar  variables  used before being set; redefined subroutines; references to undefined\nfilehandles; filehandles opened read-only that you are attempting to  write  on;  values\nused  as  a  number  that  don't  look  like numbers; using an array as though it were a\nscalar; if your subroutines recurse more than 100 deep; and innumerable other things.\n\nThis switch really just enables the global $^W variable; normally, the lexically  scoped\n\"use  warnings\"  pragma  is  preferred.  You  can  disable  or promote into fatal errors\nspecific warnings using  \"WARN\"  hooks,  as  described  in  perlvar  and  \"warn\"  in\nperlfunc.   See  also  perldiag  and  perltrap.  A fine-grained warning facility is also\navailable if you want to manipulate entire classes of warnings; see warnings.\n",
                    "flag": "-w"
                },
                {
                    "name": "-W",
                    "content": "",
                    "flag": "-W"
                },
                {
                    "name": "-X",
                    "content": "Forbidden in \"PERL5OPT\".\n",
                    "flag": "-X"
                },
                {
                    "name": "-x",
                    "content": "",
                    "flag": "-x"
                },
                {
                    "name": "-x_",
                    "content": "tells Perl that the program is embedded in a larger chunk of unrelated text, such as  in\na mail message.  Leading garbage will be discarded until the first line that starts with\n\"#!\"  and  contains  the  string  \"perl\".   Any meaningful switches on that line will be\napplied.\n\nAll references to line numbers by the program (warnings, errors, ...)   will  treat  the\n\"#!\" line as the first line.  Thus a warning on the 2nd line of the program, which is on\nthe  100th  line  in  the file will be reported as line 2, not as line 100.  This can be\noverridden by using the \"#line\" directive.  (See \"Plain Old Comments (Not!)\" in perlsyn)\n\nIf a directory name is specified, Perl will switch to that directory before running  the\nprogram.  The -x switch controls only the disposal of leading garbage.  The program must\nbe  terminated  with  \"END\" if there is trailing garbage to be ignored;  the program\ncan process any or all of the trailing garbage via the \"DATA\" filehandle if desired.\n\nThe  directory,  if  specified,  must  appear  immediately  following  the  -x  with  no\nintervening whitespace.\n"
                }
            ]
        },
        "ENVIRONMENT": {
            "content": "HOME        Used if \"chdir\" has no argument.\n\nLOGDIR      Used if \"chdir\" has no argument and \"HOME\" is not set.\n\nPATH        Used in executing subprocesses, and in finding the program if \"-S\" is used.\n\nPERL5LIB    A  list  of directories in which to look for Perl library files before looking in\nthe   standard   library.    Any   architecture-specific   and   version-specific\ndirectories,   such  as  version/archname/,  version/,  or  archname/  under  the\nspecified locations are automatically included if they exist,  with  this  lookup\ndone  at  interpreter  startup  time.   In addition, any directories matching the\nentries in $Config{incversionlist} are added.  (These typically  would  be  for\nolder compatible perl versions installed in the same directory tree.)\n\nIf  PERL5LIB  is not defined, \"PERLLIB\" is used.  Directories are separated (like\nin PATH) by a colon on Unixish platforms and  by  a  semicolon  on  Windows  (the\nproper path separator being given by the command \"perl -V:pathsep\").\n\nWhen  running  taint  checks,  either  because  the program was running setuid or\nsetgid, or the \"-T\" or \"-t\" switch was specified, neither PERL5LIB nor  \"PERLLIB\"\nis consulted. The program should instead say:\n\nuse lib \"/my/directory\";\n\nPERL5OPT    Command-line  options  (switches).   Switches  in this variable are treated as if\nthey were on every Perl command  line.   Only  the  -[CDIMTUWdmtw]  switches  are\nallowed.   When  running  taint  checks  (either  because the program was running\nsetuid or setgid, or because the \"-T\" or \"-t\" switch was used), this variable  is\nignored.   If  PERL5OPT  begins  with -T, tainting will be enabled and subsequent\noptions ignored.  If PERL5OPT  begins  with  -t,  tainting  will  be  enabled,  a\nwritable dot removed from @INC, and subsequent options honored.\n\nPERLIO      A  space  (or  colon)  separated  list  of PerlIO layers. If perl is built to use\nPerlIO system for IO (the default) these layers affect Perl's IO.\n\nIt is conventional to start layer names with a colon (for example, \":perlio\")  to\nemphasize  their  similarity  to  variable \"attributes\". But the code that parses\nlayer specification strings, which is also used to decode the PERLIO  environment\nvariable, treats the colon as a separator.\n\nAn  unset  or  empty  PERLIO  is equivalent to the default set of layers for your\nplatform; for example, \":unix:perlio\" on Unix-like systems  and  \":unix:crlf\"  on\nWindows and other DOS-like systems.\n\nThe list becomes the default for all Perl's IO. Consequently only built-in layers\ncan  appear  in  this  list,  as external layers (such as :encoding()) need IO in\norder to load them!  See \"open pragma\" for  how  to  add  external  encodings  as\ndefaults.\n\nLayers  it  makes sense to include in the PERLIO environment variable are briefly\nsummarized below. For more details see PerlIO.\n\n:crlf   A layer which does CRLF to \"\\n\"  translation  distinguishing  \"text\"  and\n\"binary\" files in the manner of MS-DOS and similar operating systems, and\nalso provides buffering similar to \":perlio\" on these architectures.\n\n:perlio This  is  a re-implementation of stdio-like buffering written as a PerlIO\nlayer.  As such  it  will  call  whatever  layer  is  below  it  for  its\noperations, typically \":unix\".\n\n:stdio  This  layer  provides  a  PerlIO  interface  by  wrapping system's ANSI C\n\"stdio\" library calls. The layer provides both buffering  and  IO.   Note\nthat  the \":stdio\" layer does not do CRLF translation even if that is the\nplatform's normal behaviour. You will need a \":crlf\" layer above it to do\nthat.\n\n:unix   Low-level layer that calls \"read\", \"write\", \"lseek\", etc.\n\nThe default set of layers should give acceptable results on all platforms.\n\nFor Unix platforms that will be the equivalent  of  \":unix:perlio\"  or  \":stdio\".\nConfigure is set up to prefer the \":stdio\" implementation if the system's library\nprovides  for  fast  access  to  the buffer (not common on modern architectures);\notherwise, it uses the \":unix:perlio\" implementation.\n\nOn Win32 the default in this release (5.30) is \":unix:crlf\". Win32's \":stdio\" has\na number of bugs/mis-features for Perl IO which are  somewhat  depending  on  the\nversion  and  vendor of the C compiler. Using our own \":crlf\" layer as the buffer\navoids those issues and makes things more uniform.\n\nThis release (5.30) uses \":unix\" as the bottom layer on Win32, and so still  uses\nthe C compiler's numeric file descriptor routines.\n\nThe  PERLIO  environment variable is completely ignored when Perl is run in taint\nmode.\n\nPERLIODEBUG\nIf set to the name of a file or device when Perl is run with the -Di command-line\nswitch, the logging of  certain  operations  of  the  PerlIO  subsystem  will  be\nredirected  to  the  specified  file  rather  than  going to stderr, which is the\ndefault. The file is opened in append mode. Typical uses are in Unix:\n\n% env PERLIODEBUG=/tmp/perlio.log perl -Di script ...\n\nand under Win32, the approximately equivalent:\n\n> set PERLIODEBUG=CON\nperl -Di script ...\n\nThis functionality is disabled for setuid scripts, for scripts run with \"-T\", and\nfor scripts run on a Perl built without \"-DDEBUGGING\" support.\n\nPERLLIB     A list of directories in which to look for Perl library files before  looking  in\nthe standard library.  If \"PERL5LIB\" is defined, PERLLIB is not used.\n\nThe  PERLLIB environment variable is completely ignored when Perl is run in taint\nmode.\n\nPERL5DB     The command used to load the debugger code.  The default is:\n\nBEGIN { require \"perl5db.pl\" }\n\nThe PERL5DB environment variable is only used when Perl is started  with  a  bare\n\"-d\" switch.\n\nPERL5DBTHREADED\nIf  set  to  a true value, indicates to the debugger that the code being debugged\nuses threads.\n\nPERL5SHELL (specific to the Win32 port)\nOn Win32 ports only, may be set to  an  alternative  shell  that  Perl  must  use\ninternally  for  executing  \"backtick\" commands or system().  Default is \"cmd.exe\n/x/d/c\" on WindowsNT and \"command.com /c\" on Windows95.  The value is  considered\nspace-separated.   Precede any character that needs to be protected, like a space\nor backslash, with another backslash.\n\nNote that Perl doesn't use COMSPEC for this purpose because COMSPEC  has  a  high\ndegree  of  variability  among  users, leading to portability concerns.  Besides,\nPerl can use a shell that may not be fit for interactive use, and setting COMSPEC\nto such a shell may interfere with  the  proper  functioning  of  other  programs\n(which usually look in COMSPEC to find a shell fit for interactive use).\n\nBefore  Perl  5.10.0  and  5.8.8,  PERL5SHELL  was not taint checked when running\nexternal commands.  It  is  recommended  that  you  explicitly  set  (or  delete)\n$ENV{PERL5SHELL} when running in taint mode under Windows.\n\nPERLALLOWNONIFSLSP (specific to the Win32 port)\nSet to 1 to allow the use of non-IFS compatible LSPs (Layered Service Providers).\nPerl normally searches for an IFS-compatible LSP because this is required for its\nemulation  of  Windows  sockets  as  real  filehandles.   However, this may cause\nproblems if you have a firewall such as McAfee Guardian, which requires that  all\napplications  use  its  LSP but which is not IFS-compatible, because clearly Perl\nwill normally avoid using such an LSP.\n\nSetting this environment variable to 1 means that Perl will simply use the  first\nsuitable LSP enumerated in the catalog, which keeps McAfee Guardian happy--and in\nthat  particular case Perl still works too because McAfee Guardian's LSP actually\nplays other games which allow applications requiring IFS compatibility to work.\n\nPERLDEBUGMSTATS\nRelevant only if Perl is compiled  with  the  \"malloc\"  included  with  the  Perl\ndistribution; that is, if \"perl -V:dmymalloc\" is \"define\".\n\nIf  set,  this dumps out memory statistics after execution.  If set to an integer\ngreater than one, also dumps out memory statistics after compilation.\n\nPERLDESTRUCTLEVEL\nControls the behaviour of global destruction of  objects  and  other  references.\nSee \"PERLDESTRUCTLEVEL\" in perlhacktips for more information.\n\nPERLDLNONLAZY\nSet  to  \"1\"  to  have Perl resolve all undefined symbols when it loads a dynamic\nlibrary.  The default behaviour  is  to  resolve  symbols  when  they  are  used.\nSetting  this variable is useful during testing of extensions, as it ensures that\nyou get an error on misspelled function names even if the test suite doesn't call\nthem.\n\nPERLENCODING\nIf using the \"use  encoding\"  pragma  without  an  explicit  encoding  name,  the\nPERLENCODING environment variable is consulted for an encoding name.\n\nPERLHASHSEED\n(Since  Perl  5.8.1,  new  semantics  in  Perl  5.18.0)   Used  to  override  the\nrandomization of Perl's  internal  hash  function.  The  value  is  expressed  in\nhexadecimal,  and  may  include  a  leading 0x. Truncated patterns are treated as\nthough they are suffixed with sufficient 0's as required.\n\nIf the option is provided, and \"PERLPERTURBKEYS\" is NOT set, then  a  value  of\n'0'  implies  \"PERLPERTURBKEYS=0\"/\"PERLPERTURBKEYS=NO\"  and  any  other value\nimplies    \"PERLPERTURBKEYS=2\"/\"PERLPERTURBKEYS=DETERMINISTIC\".    See    the\ndocumentation   for   PERLPERTURBKEYS   for  important  caveats  regarding  the\n\"DETERMINISTIC\" mode.\n\nPLEASE NOTE: The hash seed is sensitive information.  Hashes  are  randomized  to\nprotect against local and remote attacks against Perl code. By manually setting a\nseed, this protection may be partially or completely lost.\n\nSee   \"Algorithmic  Complexity  Attacks\"  in  perlsec,  \"PERLPERTURBKEYS\",  and\n\"PERLHASHSEEDDEBUG\" for more information.\n\nPERLPERTURBKEYS\n(Since Perl 5.18.0)  Set to \"0\" or \"NO\" then traversing keys will  be  repeatable\nfrom  run  to  run for the same \"PERLHASHSEED\".  Insertion into a hash will not\nchange the order, except to provide for more space in  the  hash.  When  combined\nwith setting PERLHASHSEED this mode is as close to pre 5.18 behavior as you can\nget.\n\nWhen  set to \"1\" or \"RANDOM\" then traversing keys will be randomized.  Every time\na hash is inserted into the key order will change in a random fashion. The  order\nmay  not  be repeatable in a following program run even if the PERLHASHSEED has\nbeen specified. This is the default mode for perl when no PERLHASHSEED has been\nexplicitly provided.\n\nWhen set to \"2\" or \"DETERMINISTIC\" then inserting keys into a hash will cause the\nkey order to change, but in a way that is repeatable from program run to  program\nrun,  provided that the same hash seed is used, and that the code does not itself\nperform any non-deterministic operations  and  also  provided  exactly  the  same\nenvironment  context.   Adding or removing an environment variable may and likely\nwill change the key order. If any part of the  code  builds  a  hash  using  non-\ndeterministic  keys,  for  instance  a  hash  keyed  by the stringified form of a\nreference, or the address of the objects it contains, then this  may  and  likely\nwill  have  a  global  effect on the key order of *every* hash in the process. To\nwork properly this setting MUST be coupled with  the  PERLHASHSEED  to  produce\ndeterministic results, and in fact, if you do set the \"PERLHASHSEED\" explicitly\nyou do not need to set this as well, it will be automatically set to this mode.\n\nNOTE:  Use  of  this  option  is  considered  insecure,  and is intended only for\ndebugging non-deterministic behavior in Perl's hash function. Do not  use  it  in\nproduction.\n\nSee   \"Algorithmic  Complexity  Attacks\"  in  perlsec  and  \"PERLHASHSEED\"  and\n\"PERLHASHSEEDDEBUG\" for  more  information.  You  can  get  and  set  the  key\ntraversal  mask  for  a specific hash by using the hashtraversalmask() function\nfrom Hash::Util.\n\nPERLHASHSEEDDEBUG\n(Since Perl 5.8.1.)  Set to \"1\" to display (to STDERR) information about the hash\nfunction, seed, and what type of key traversal randomization is in effect at  the\nbeginning    of    execution.    This,   combined   with   \"PERLHASHSEED\"   and\n\"PERLPERTURBKEYS\" is intended to aid in  debugging  nondeterministic  behaviour\ncaused by hash randomization.\n\nNote  that  any  information about the hash function, especially the hash seed is\nsensitive information: by knowing it, one can craft  a  denial-of-service  attack\nagainst Perl code, even remotely; see \"Algorithmic Complexity Attacks\" in perlsec\nfor  more  information. Do not disclose the hash seed to people who don't need to\nknow it. See also hashseed() and hashtraversalmask().\n\nAn example output might be:\n\nHASHFUNCTION = ONEATATIMEHARD HASHSEED = 0x652e9b9349a7a032 PERTURBKEYS = 1 (RANDOM)\n\nPERLMEMLOG\nIf  your  Perl  was  configured  with   -Accflags=-DPERLMEMLOG,   setting   the\nenvironment variable \"PERLMEMLOG\" enables logging debug messages. The value has\nthe  form  \"<number>[m][s][t]\",  where \"number\" is the file descriptor number you\nwant to write to (2 is default), and the combination of  letters  specifies  that\nyou  want  information  about (m)emory and/or (s)v, optionally with (t)imestamps.\nFor example, \"PERLMEMLOG=1mst\" logs all information to stdout. You can write to\nother opened file descriptors in a variety of ways:\n\n$ 3>foo3 PERLMEMLOG=3m perl ...\n\nPERLROOT (specific to the VMS port)\nA translation-concealed rooted logical name that contains Perl  and  the  logical\ndevice  for  the  @INC path on VMS only.  Other logical names that affect Perl on\nVMS include PERLSHR,  PERLENVTABLES,  and  SYS$TIMEZONEDIFFERENTIAL,  but  are\noptional  and  discussed  further in perlvms and in README.vms in the Perl source\ndistribution.\n\nPERLSIGNALS\nAvailable in Perls 5.8.1 and later.   If  set  to  \"unsafe\",  the  pre-Perl-5.8.0\nsignal  behaviour (which is immediate but unsafe) is restored.  If set to \"safe\",\nthen safe (but deferred) signals are used.  See \"Deferred Signals (Safe Signals)\"\nin perlipc.\n\nPERLUNICODE\nEquivalent to the -C command-line switch.   Note  that  this  is  not  a  boolean\nvariable.  Setting this to \"1\" is not the right way to \"enable Unicode\" (whatever\nthat would mean).  You can use \"0\" to \"disable Unicode\", though (or alternatively\nunset PERLUNICODE in your shell before starting Perl).  See the  description  of\nthe -C switch for more information.\n\nPERLUSEUNSAFEINC\nIf perl has been configured to not have the current directory in @INC by default,\nthis variable can be set to \"1\" to reinstate it.  It's primarily intended for use\nwhile  building  and  testing modules that have not been updated to deal with \".\"\nnot being in @INC and should not be set in the environment for day-to-day use.\n\nSYS$LOGIN (specific to the VMS port)\nUsed if chdir has no argument and \"HOME\" and \"LOGDIR\" are not set.\n\nPERLINTERNALRANDSEED\nSet to a non-negative integer to seed the random number generator used internally\nby perl for a variety of purposes.\n\nIgnored if perl is run setuid or setgid.  Used  only  for  some  limited  startup\nrandomization (hash keys) if \"-T\" or \"-t\" perl is started with tainting enabled.\n\nPerl may be built to ignore this variable.\n\nPERLRANDSEED\nWhen  set  to  an integer value this value will be used to seed the perl internal\nrandom number generator used for rand() when  it  is  used  without  an  explicit\nsrand() call or for when an explicit no-argument srand() call is made.\n\nNormally  calling  rand()  prior to calling srand() or calling srand() explicitly\nwith no arguments should result  in  the  random  number  generator  using  \"best\nefforts\"  to seed the generator state with a relatively high quality random seed.\nWhen  this  environment  variable  is  set  then   the   seeds   used   will   be\ndeterministically  computed  from the value provided in the env var in such a way\nthat the application process and any forks or threads  should  continue  to  have\ntheir  own  unique  seed  but  that  the  program may be run twice with identical\nresults as far as rand() goes (assuming all else is equal).\n\nPERLRANDSEED is intended for performance  measurements  and  debugging  and  is\nexplicitly NOT intended for stable testing. The only guarantee is that a specific\nperl  executable  will  produce  the  same  results  twice  in a row, there is no\nguarantee that the results will be the same between perl releases or on different\narchitectures.\n\nIgnored if perl is run setuid or setgid.\n\nPerl also has environment variables that control how Perl handles data specific to particular\nnatural languages; see perllocale.\n\nPerl and its various modules and components, including its  test  frameworks,  may  sometimes\nmake  use of certain other environment variables.  Some of these are specific to a particular\nplatform.  Please consult the appropriate module documentation and any documentation for your\nplatform (like perlsolaris, perllinux, perlmacosx, perlwin32, etc) for variables peculiar  to\nthose specific situations.\n\nPerl  makes  all  environment  variables  available to the program being executed, and passes\nthese along to any child processes it starts.  However, programs running setuid would do well\nto execute the following lines before doing anything else, just to keep people honest:\n\n$ENV{PATH}  = \"/bin:/usr/bin\";    # or whatever you need\n$ENV{SHELL} = \"/bin/sh\" if exists $ENV{SHELL};\ndelete @ENV{qw(IFS CDPATH ENV BASHENV)};\n",
            "subsections": []
        },
        "ORDER OF APPLICATION": {
            "content": "Some options, in particular \"-I\", \"-M\", \"PERL5LIB\" and \"PERL5OPT\" can interact, and the order\nin which they are applied is important.\n\nNote that this section does not document what actually happens inside the  perl  interpreter,\nit documents what effectively happens.\n\n-I  The effect of multiple \"-I\" options is to \"unshift\" them onto @INC from right to left. So\nfor example:\n\nperl -I 1 -I 2 -I 3\n\nwill  first  prepend  3  onto  the front of @INC, then prepend 2, and then prepend 1. The\nresult is that @INC begins with:\n\nqw(1 2 3)\n\n-M  Multiple \"-M\" options are processed from left to right. So this:\n\nperl -Mlib=1 -Mlib=2 -Mlib=3\n\nwill first use the lib pragma to prepend 1 to @INC, then it will prepend 2, then it  will\nprepend 3, resulting in an @INC that begins with:\n\nqw(3 2 1)\n\nthe PERL5LIB environment variable\nThis contains a list of directories, separated by colons. The entire list is prepended to\n@INC in one go. This:\n\nPERL5LIB=1:2:3 perl\n\nwill result in an @INC that begins with:\n\nqw(1 2 3)\n\ncombinations of -I, -M and PERL5LIB\n\"PERL5LIB\"  is  applied  first, then all the \"-I\" arguments, then all the \"-M\" arguments.\nThis:\n\nPERL5LIB=e1:e2 perl -I i1 -Mlib=m1 -I i2 -Mlib=m2\n\nwill result in an @INC that begins with:\n\nqw(m2 m1 i1 i2 e1 e2)\n\nthe PERL5OPT environment variable\nThis contains a space separated list of switches. We only consider the  effects  of  \"-M\"\nand \"-I\" in this section.\n\nAfter  normal processing of \"-I\" switches from the command line, all the \"-I\" switches in\n\"PERL5OPT\" are extracted. They are processed from left to right instead of from right  to\nleft.  Also note that while whitespace is allowed between a \"-I\" and its directory on the\ncommand line, it is not allowed in \"PERL5OPT\".\n\nAfter normal processing of \"-M\" switches from the command line, all the \"-M\" switches  in\n\"PERL5OPT\"  are  extracted. They are processed from left to right, i.e. the same as those\non the command line.\n\nAn example may make this clearer:\n\nexport PERL5OPT=\"-Mlib=optm1 -Iopti1 -Mlib=optm2 -Iopti2\"\nexport PERL5LIB=e1:e2\nperl -I i1 -Mlib=m1 -I i2 -Mlib=m2\n\nwill result in an @INC that begins with:\n\nqw(\noptm2\noptm1\n\nm2\nm1\n\nopti2\nopti1\n\ni1\ni2\n\ne1\ne2\n)\n\nOther complications\nThere are some complications that are ignored in the examples above:\n\narch and version subdirs\nAll of \"-I\", \"PERL5LIB\" and \"use lib\" will also prepend arch and version  subdirs  if\nthey are present\n\nsitecustomize.pl\n\nperl v5.38.2                                 2026-06-12                                   PERLRUN(1)",
            "subsections": []
        }
    },
    "summary": "perlrun - how to execute the Perl interpreter",
    "flags": [
        {
            "flag": "-0",
            "long": null,
            "arg": null,
            "description": "specifies the input record separator ($/) as an octal or hexadecimal number. If there are no digits, the null character is the separator. Other switches may precede or follow the digits. For example, if you have a version of find which can print filenames terminated by the null character, you can say this: find . -name '*.orig' -print0 | perl -n0e unlink The special value 00 will cause Perl to slurp files in paragraph mode. Any value 0400 or above will cause Perl to slurp files whole, but by convention the value 0777 is the one normally used for this purpose. The \"-g\" flag is a simpler alias for it. You can also specify the separator character using hexadecimal notation: -0xHHH..., where the \"H\" are valid hexadecimal digits. Unlike the octal form, this one may be used to specify any Unicode character, even those beyond 0xFF. So if you really want a record separator of 0777, specify it as -0x1FF. (This means that you cannot use the \"-x\" option with a directory name that consists of hexadecimal digits, or else Perl will think you have specified a hex number to -0.)"
        },
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": "@F array is done as the first thing inside the implicit while loop produced by the \"-n\" or \"-p\". perl -ane 'print pop(@F), \"\\n\";' is equivalent to while (<>) { @F = split(' '); print pop(@F), \"\\n\"; } An alternate delimiter may be specified using -F. -a implicitly sets \"-n\"."
        },
        {
            "flag": "-C",
            "long": null,
            "arg": null,
            "description": "The -C flag controls some of the Perl Unicode features. As of 5.8.1, the -C can be followed either by a number or a list of option letters. The letters, their numeric values, and effects are as follows; listing the letters is equal to summing the numbers. I 1 STDIN is assumed to be in UTF-8 O 2 STDOUT will be in UTF-8 E 4 STDERR will be in UTF-8 S 7 I + O + E i 8 UTF-8 is the default PerlIO layer for input streams o 16 UTF-8 is the default PerlIO layer for output streams D 24 i + o A 32 the @ARGV elements are expected to be strings encoded in UTF-8 L 64 normally the \"IOEioA\" are unconditional, the L makes them conditional on the locale environment variables (the LCALL, LCCTYPE, and LANG, in the order of decreasing precedence) -- if the variables indicate UTF-8, then the selected \"IOEioA\" are in effect a 256 Set ${^UTF8CACHE} to -1, to run the UTF-8 caching code in debugging mode. For example, -COE and -C6 will both turn on UTF-8-ness on both STDOUT and STDERR. Repeating letters is just redundant, not cumulative nor toggling. The \"io\" options mean that any subsequent open() (or similar I/O operations) in main program scope will have the \":utf8\" PerlIO layer implicitly applied to them, in other words, UTF-8 is expected from any input stream, and UTF-8 is produced to any output stream. This is just the default set via \"${^OPEN}\", with explicit layers in open() and with binmode() one can manipulate streams as usual. This has no effect on code run in modules. -C on its own (not followed by any number or option list), or the empty string \"\" for the \"PERLUNICODE\" environment variable, has the same effect as -CSDL. In other words, the standard I/O handles and the default open() layer are UTF-8-fied but only if the locale environment variables indicate a UTF-8 locale. This behaviour follows the implicit (and problematic) UTF-8 behaviour of Perl 5.8.0. (See \"UTF-8 no longer default under UTF-8 locales\" in perl581delta.) You can use -C0 (or \"0\" for \"PERLUNICODE\") to explicitly disable all the above Unicode features. The read-only magic variable \"${^UNICODE}\" reflects the numeric value of this setting. This variable is set during Perl startup and is thereafter read-only. If you want runtime effects, use the three-arg open() (see \"open\" in perlfunc), the two-arg binmode() (see \"binmode\" in perlfunc), and the \"open\" pragma (see open). (In Perls earlier than 5.8.1 the -C switch was a Win32-only switch that enabled the use of Unicode-aware \"wide system call\" Win32 APIs. This feature was practically unused, however, and the command line switch was therefore \"recycled\".) Note: Since perl 5.10.1, if the -C option is used on the \"#!\" line, it must be specified on the command line as well, since the standard streams are already set up at this point in the execution of the perl interpreter. You can also use binmode() to set the encoding of an I/O stream."
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "Actually, it will execute any \"BEGIN\", \"UNITCHECK\", or \"CHECK\" blocks and any \"use\" statements: these are considered as occurring outside the execution of your program. \"INIT\" and \"END\" blocks, however, will be skipped."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "indicates to the debugger that threads will be used in the code being debugged."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "runs the program under the control of a debugging, profiling, or tracing module installed as \"Devel::MOD\". E.g., -d:DProf executes the program using the \"Devel::DProf\" profiler. As with the -M flag, options may be passed to the \"Devel::MOD\" package where they will be received and interpreted by the \"Devel::MOD::import\" routine. Again, like -M, use --d:-MOD to call \"Devel::MOD::unimport\" instead of import. The comma-separated list of options must follow a \"=\" character. If t is specified, it indicates to the debugger that threads will be used in the code being debugged. See perldebug."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "sets debugging flags. This switch is enabled only if your perl binary has been built with debugging enabled: normal production perls won't have been. For example, to watch how perl executes your program, use -Dtls. Another nice value is -Dx, which lists your compiled syntax tree, and -Dr displays compiled regular expressions; the format of the output is explained in perldebguts. As an alternative, specify a number instead of list of letters (e.g., -D14 is equivalent to -Dtls): 1 p Tokenizing and parsing (with v, displays parse stack) 2 s Stack snapshots (with v, displays all stacks) 4 l Context (loop) stack processing 8 t Trace execution 16 o Method and overloading resolution 32 c String/numeric conversions 64 P Print profiling info, source file input state 128 m Memory and SV allocation 256 f Format processing 512 r Regular expression parsing and execution 1024 x Syntax tree dump 2048 u Tainting checks 4096 U Unofficial, User hacking (reserved for private, unreleased use) 8192 h Show hash randomization debug output (changes to PLhashrandbits and their origin) 16384 X Scratchpad allocation 32768 D Cleaning up 65536 S Op slab allocation 131072 T Tokenizing 262144 R Include reference counts of dumped variables (eg when using -Ds) 524288 J show s,t,P-debug (don't Jump over) on opcodes within package DB 1048576 v Verbose: use in conjunction with other flags to increase the verbosity of the output. Is a no-op on many of the other flags 2097152 C Copy On Write 4194304 A Consistency checks on internal structures 8388608 q quiet - currently only suppresses the \"EXECUTING\" message 16777216 M trace smart match resolution 33554432 B dump suBroutine definitions, including special Blocks like BEGIN 67108864 L trace Locale-related info; what gets output is very subject to change 134217728 i trace PerlIO layer processing. Set PERLIODEBUG to the filename to trace to. 268435456 y trace y///, tr/// compilation and execution All these flags require -DDEBUGGING when you compile the Perl executable (but see \":opd\" in Devel::Peek or \"'debug' mode\" in re which may change this). See the INSTALL file in the Perl source distribution for how to do this. If you're just trying to get a print out of each line of Perl code as it executes, the way that \"sh -x\" provides for shell scripts, you can't use Perl's -D switch. Instead do this # If you have \"env\" utility env PERLDBOPTS=\"NonStop=1 AutoTrace=1 frame=2\" perl -dS program # Bourne shell syntax $ PERLDBOPTS=\"NonStop=1 AutoTrace=1 frame=2\" perl -dS program # csh syntax % (setenv PERLDBOPTS \"NonStop=1 AutoTrace=1 frame=2\"; perl -dS program) See perldebug for details and variations."
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": "may be used to enter one line of program. If -e is given, Perl will not look for a filename in the argument list. Multiple -e commands may be given to build up a multi- line script. Make sure to use semicolons where you would in a normal program."
        },
        {
            "flag": "-E",
            "long": null,
            "arg": null,
            "description": "behaves just like -e, except that it implicitly enables all optional features (in the main compilation unit). See feature."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "Perl can be built so that it by default will try to execute $Config{sitelib}/sitecustomize.pl at startup (in a BEGIN block). This is a hook that allows the sysadmin to customize how Perl behaves. It can for instance be used to add entries to the @INC array to make Perl find modules in non-standard locations. Perl actually inserts the following code: BEGIN { do { local $!; -f \"$Config{sitelib}/sitecustomize.pl\"; } && do \"$Config{sitelib}/sitecustomize.pl\"; } Since it is an actual \"do\" (not a \"require\"), sitecustomize.pl doesn't need to return a true value. The code is run in package \"main\", in its own lexical scope. However, if the script dies, $@ will not be set. The value of $Config{sitelib} is also determined in C code and not read from \"Config.pm\", which is not loaded. The code is executed very early. For example, any changes made to @INC will show up in the output of `perl -V`. Of course, \"END\" blocks will be likewise executed very late. To determine at runtime if this capability has been compiled in your perl, you can check the value of $Config{usesitecustomize}."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "specifies the pattern to split on for \"-a\". The pattern may be surrounded by \"//\", \"\", or '', otherwise it will be put in single quotes. You can't use literal whitespace or NUL characters in the pattern. -F implicitly sets both \"-a\" and \"-n\"."
        },
        {
            "flag": "-g",
            "long": null,
            "arg": null,
            "description": "words, it causes Perl to read whole files at once, instead of line by line. This flag is a simpler alias for -0777. Mnemonics: gobble, grab, gulp."
        },
        {
            "flag": "-h",
            "long": null,
            "arg": null,
            "description": "-? synonym for -h: prints a summary of the options."
        },
        {
            "flag": "-i",
            "long": null,
            "arg": null,
            "description": "specifies that files processed by the \"<>\" construct are to be edited in-place. It does this by renaming the input file, opening the output file by the original name, and selecting that output file as the default for print() statements. The extension, if supplied, is used to modify the name of the old file to make a backup copy, following these rules: If no extension is supplied, and your system supports it, the original file is kept open without a name while the output is redirected to a new file with the original filename. When perl exits, cleanly or not, the original file is unlinked. If the extension doesn't contain a \"*\", then it is appended to the end of the current filename as a suffix. If the extension does contain one or more \"*\" characters, then each \"*\" is replaced with the current filename. In Perl terms, you could think of this as: ($backup = $extension) =~ s/\\*/$filename/g; This allows you to add a prefix to the backup file, instead of (or in addition to) a suffix: $ perl -pi'orig*' -e 's/bar/baz/' fileA # backup to # 'origfileA' Or even to place backup copies of the original files into another directory (provided the directory already exists): $ perl -pi'old/*.orig' -e 's/bar/baz/' fileA # backup to # 'old/fileA.orig' These sets of one-liners are equivalent: $ perl -pi -e 's/bar/baz/' fileA # overwrite current file $ perl -pi'*' -e 's/bar/baz/' fileA # overwrite current file $ perl -pi'.orig' -e 's/bar/baz/' fileA # backup to 'fileA.orig' $ perl -pi'*.orig' -e 's/bar/baz/' fileA # backup to 'fileA.orig' From the shell, saying $ perl -p -i.orig -e \"s/foo/bar/; ... \" is the same as using the program: #!/usr/bin/perl -pi.orig s/foo/bar/; which is equivalent to #!/usr/bin/perl $extension = '.orig'; LINE: while (<>) { if ($ARGV ne $oldargv) { if ($extension !~ /\\*/) { $backup = $ARGV . $extension; } else { ($backup = $extension) =~ s/\\*/$ARGV/g; } rename($ARGV, $backup); open(ARGVOUT, \">$ARGV\"); select(ARGVOUT); $oldargv = $ARGV; } s/foo/bar/; } continue { print; # this prints to original filename } select(STDOUT); except that the -i form doesn't need to compare $ARGV to $oldargv to know when the filename has changed. It does, however, use ARGVOUT for the selected filehandle. Note that STDOUT is restored as the default output filehandle after the loop. As shown above, Perl creates the backup file whether or not any output is actually changed. So this is just a fancy way to copy files: $ perl -p -i'/some/file/path/*' -e 1 file1 file2 file3... or $ perl -p -i'.orig' -e 1 file1 file2 file3... You can use \"eof\" without parentheses to locate the end of each input file, in case you want to append to each file, or reset line numbering (see example in \"eof\" in perlfunc). If, for a given file, Perl is unable to create the backup file as specified in the extension then it will skip that file and continue on with the next one (if it exists). For a discussion of issues surrounding file permissions and -i, see \"Why does Perl let me delete read-only files? Why does -i clobber protected files? Isn't this a bug in Perl?\" in perlfaq5. You cannot use -i to create directories or to strip extensions from files. Perl does not expand \"~\" in filenames, which is good, since some folks use it for their backup files: $ perl -pi~ -e 's/foo/bar/' file1 file2 file3... Note that because -i renames or deletes the original file before creating a new file of the same name, Unix-style soft and hard links will not be preserved. Finally, the -i switch does not impede execution when no files are given on the command line. In this case, no backup is made (the original file cannot, of course, be determined) and processing proceeds from STDIN to STDOUT as might be expected."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Directories specified by -I are prepended to the search path for modules (@INC)."
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": "enables automatic line-ending processing. It has two separate effects. First, it automatically chomps $/ (the input record separator) when used with \"-n\" or \"-p\". Second, it assigns \"$\\\" (the output record separator) to have the value of octnum so that any print statements will have that separator added back on. If octnum is omitted, sets \"$\\\" to the current value of $/. For instance, to trim lines to 80 columns: perl -lpe 'substr($, 80) = \"\"' Note that the assignment \"$\\ = $/\" is done when the switch is processed, so the input record separator can be different than the output record separator if the -l switch is followed by a -0 switch: gnufind / -print0 | perl -ln0e 'print \"found $\" if -p' This sets \"$\\\" to newline and then sets $/ to the null character."
        },
        {
            "flag": "-m",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-M",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-M",
            "long": null,
            "arg": null,
            "description": "-[mM][-]module=arg[,arg]... -mmodule executes \"use\" module \"();\" before executing your program. This loads the module, but does not call its \"import\" method, so does not import subroutines and does not give effect to a pragma. -Mmodule executes \"use\" module \";\" before executing your program. This loads the module and calls its \"import\" method, causing the module to have its default effect, typically importing subroutines or giving effect to a pragma. You can use quotes to add extra code after the module name, e.g., '-MMODULE qw(foo bar)'. If the first character after the -M or -m is a dash (-) then the 'use' is replaced with 'no'. This makes no difference for -m. A little builtin syntactic sugar means you can also say -mMODULE=foo,bar or -MMODULE=foo,bar as a shortcut for '-MMODULE qw(foo bar)'. This avoids the need to use quotes when importing symbols. The actual code generated by -MMODULE=foo,bar is \"use module split(/,/,q{foo,bar})\". Note that the \"=\" form removes the distinction between -m and -M; that is, -mMODULE=foo,bar is the same as -MMODULE=foo,bar. A consequence of the \"split\" formulation is that -MMODULE=number never does a version check, unless \"MODULE::import()\" itself is set up to do a version check, which could happen for example if MODULE inherits from Exporter."
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "over filename arguments somewhat like sed -n or awk: LINE: while (<>) { ... # your program goes here } Note that the lines are not printed by default. See \"-p\" to have lines printed. If a file named by an argument cannot be opened for some reason, Perl warns you about it and moves on to the next file. Also note that \"<>\" passes command line arguments to \"open\" in perlfunc, which doesn't necessarily interpret them as file names. See perlop for possible security implications. Here is an efficient way to delete all files that haven't been modified for at least a week: find . -mtime +7 -print | perl -nle unlink This is faster than using the -exec switch of find because you don't have to start a process on every filename found (but it's not faster than using the -delete switch available in newer versions of find. It does suffer from the bug of mishandling newlines in pathnames, which you can fix if you follow the example under -0. \"BEGIN\" and \"END\" blocks may be used to capture control before or after the implicit program loop, just as in awk."
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "over filename arguments somewhat like sed: LINE: while (<>) { ... # your program goes here } continue { print or die \"-p destination: $!\\n\"; } If a file named by an argument cannot be opened for some reason, Perl warns you about it, and moves on to the next file. Note that the lines are printed automatically. An error occurring during printing is treated as fatal. To suppress printing use the \"-n\" switch. A -p overrides a -n switch. \"BEGIN\" and \"END\" blocks may be used to capture control before or after the implicit loop, just as in awk."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": "name but before any filename arguments (or before an argument of --). Any switch found there is removed from @ARGV and sets the corresponding variable in the Perl program, in the main package. The following program prints \"1\" if the program is invoked with a -xyz switch, and \"abc\" if it is invoked with -xyz=abc. #!/usr/bin/perl -s if ($xyz) { print \"$xyz\\n\" } Do note that a switch like --help creates the variable \"${-help}\", which is not compliant with \"use strict \"refs\"\". Also, when using this option on a script with warnings enabled you may get a lot of spurious \"used only once\" warnings. For these reasons, use of -s is discouraged. See Getopt::Long for much more flexible switch parsing."
        },
        {
            "flag": "-S",
            "long": null,
            "arg": null,
            "description": "of the program contains path separators. On some platforms, this also makes Perl append suffixes to the filename while searching for it. For example, on Win32 platforms, the \".bat\" and \".cmd\" suffixes are appended if a lookup for the original name fails, and if the name does not already end in one of those suffixes. If your Perl was compiled with \"DEBUGGING\" turned on, using the -Dp switch to Perl shows how the search progresses. Typically this is used to emulate \"#!\" startup on platforms that don't support \"#!\". It's also convenient when debugging a script that uses \"#!\", and is thus normally found by the shell's $PATH search mechanism. This example works on many platforms that have a shell compatible with Bourne shell: #!/usr/bin/perl eval 'exec /usr/bin/perl -wS $0 ${1+\"$@\"}' if 0; # ^ Run only under a shell The system ignores the first line and feeds the program to /bin/sh, which proceeds to try to execute the Perl program as a shell script. The shell executes the second line as a normal shell command, and thus starts up the Perl interpreter. On some systems $0 doesn't always contain the full pathname, so the \"-S\" tells Perl to search for the program if necessary. After Perl locates the program, it parses the lines and ignores them because the check 'if 0' is never true. If the program will be interpreted by csh, you will need to replace \"${1+\"$@\"}\" with $*, even though that doesn't understand embedded spaces (and such) in the argument list. To start up sh rather than csh, some systems may have to replace the \"#!\" line with a line containing just a colon, which will be politely ignored by Perl. Other systems can't control that, and need a totally devious construct that will work under any of csh, sh, or Perl, such as the following: eval '(exit $?0)' && eval 'exec perl -wS $0 ${1+\"$@\"}' & eval 'exec /usr/bin/perl -wS $0 $argv:q' if 0; # ^ Run only under a shell If the filename supplied contains directory separators (and so is an absolute or relative pathname), and if that file is not found, platforms that append file extensions will do so and try to look for the file with those extensions added, one by one. On DOS-like platforms, if the program does not contain directory separators, it will first be searched for in the current directory before being searched for on the PATH. On Unix platforms, the program will be searched for strictly on the PATH."
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": "warnings can now be controlled normally with no warnings qw(taint). Note: This is not a substitute for \"-T\"! This is meant to be used only as a temporary development aid while securing legacy code: for real production code and for new secure code written from scratch, always use the real \"-T\". This has no effect if your perl was built without taint support."
        },
        {
            "flag": "-T",
            "long": null,
            "arg": null,
            "description": "running setuid or setgid. It's a good idea to turn them on explicitly for programs that run on behalf of someone else whom you might not necessarily trust, such as CGI programs or any internet servers you might write in Perl. See perlsec for details. For security reasons, this option must be seen by Perl quite early; usually this means it must appear early on the command line or in the \"#!\" line for systems which support that construct."
        },
        {
            "flag": "-u",
            "long": null,
            "arg": null,
            "description": "theory take this core dump and turn it into an executable file by using the undump program (not supplied). This speeds startup at the expense of some disk space (which you can minimize by stripping the executable). (Still, a \"hello world\" executable comes out to about 200K on my machine.) If you want to execute a portion of your program before dumping, use the CORE::dump() function instead. Note: availability of undump is platform specific and may not be available for a specific port of Perl."
        },
        {
            "flag": "-U",
            "long": null,
            "arg": null,
            "description": "attempting to unlink directories while running as superuser and running setuid programs with fatal taint checks turned into warnings. Note that warnings must be enabled along with this option to actually generate the taint-check warnings."
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Prints to STDOUT the value of the named configuration variable(s), with multiples when your \"configvar\" argument looks like a regex (has non-letters). For example: $ perl -V:libc libc='/lib/libc-2.2.4.so'; $ perl -V:lib. libs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; libc='/lib/libc-2.2.4.so'; $ perl -V:lib.* libpth='/usr/local/lib /lib /usr/lib'; libs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; libext='.a'; libc='/lib/libc-2.2.4.so'; libperl='libperl.a'; .... Additionally, extra colons can be used to control formatting. A trailing colon suppresses the linefeed and terminator \";\", allowing you to embed queries into shell commands. (mnemonic: PATH separator \":\".) $ echo \"compression-vars: \" `perl -V:z.*: ` \" are here !\" compression-vars: zcat='' zip='zip' are here ! A leading colon removes the \"name=\" part of the response, this allows you to map to the name you need. (mnemonic: empty label) $ echo \"goodvfork=\"`./perl -Ilib -V::usevfork` goodvfork=false; Leading and trailing colons can be used together if you need positional parameter values without the names. Note that in the case below, the \"PERLAPI\" params are returned in alphabetical order. $ echo buildingon `perl -V::osname: -V::PERLAPI.*:` now buildingon 'linux' '5' '1' '9' now"
        },
        {
            "flag": "-w",
            "long": null,
            "arg": null,
            "description": "scalar variables used before being set; redefined subroutines; references to undefined filehandles; filehandles opened read-only that you are attempting to write on; values used as a number that don't look like numbers; using an array as though it were a scalar; if your subroutines recurse more than 100 deep; and innumerable other things. This switch really just enables the global $^W variable; normally, the lexically scoped \"use warnings\" pragma is preferred. You can disable or promote into fatal errors specific warnings using \"WARN\" hooks, as described in perlvar and \"warn\" in perlfunc. See also perldiag and perltrap. A fine-grained warning facility is also available if you want to manipulate entire classes of warnings; see warnings."
        },
        {
            "flag": "-W",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-X",
            "long": null,
            "arg": null,
            "description": "Forbidden in \"PERL5OPT\"."
        },
        {
            "flag": "-x",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "tells Perl that the program is embedded in a larger chunk of unrelated text, such as in a mail message. Leading garbage will be discarded until the first line that starts with \"#!\" and contains the string \"perl\". Any meaningful switches on that line will be applied. All references to line numbers by the program (warnings, errors, ...) will treat the \"#!\" line as the first line. Thus a warning on the 2nd line of the program, which is on the 100th line in the file will be reported as line 2, not as line 100. This can be overridden by using the \"#line\" directive. (See \"Plain Old Comments (Not!)\" in perlsyn) If a directory name is specified, Perl will switch to that directory before running the program. The -x switch controls only the disposal of leading garbage. The program must be terminated with \"END\" if there is trailing garbage to be ignored; the program can process any or all of the trailing garbage via the \"DATA\" filehandle if desired. The directory, if specified, must appear immediately following the -x with no intervening whitespace."
        }
    ],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "not_found",
        "examples": []
    }
}