CONTENTS. General Variables; Variables related to regular expressions; Variables related to filehandles. Variables related to formats.
PerldocBrowser
5.36.0
Latest
5.36.0
5.34.1
5.34.0
5.32.1
5.32.0
5.30.3
5.30.2
5.30.1
5.30.0
5.28.3
5.28.2
5.28.1
5.28.0
5.26.3
5.26.2
5.26.1
5.26.0
5.24.4
5.24.3
5.24.2
5.24.1
5.24.0
5.22.4
5.22.3
5.22.2
5.22.1
5.22.0
5.20.3
5.20.2
5.20.1
5.20.0
5.18.4
5.18.3
5.18.2
5.18.1
5.18.0
5.16.3
5.16.2
5.16.1
5.16.0
5.14.4
5.14.3
5.14.2
5.14.1
5.14.0
5.12.5
5.12.4
5.12.3
5.12.2
5.12.1
5.12.0
5.10.1
5.10.0
5.8.9
5.8.8
5.8.7
5.8.6
5.8.5
5.8.4
5.8.3
5.8.2
5.8.1
5.8.0
5.6.2
5.6.1
5.6.0
5.005_04
5.005_03
5.005_02
5.005_01
5.005
Dev
blead
5.37.4
5.37.3
5.37.2
5.37.1
5.37.0
5.36.0-RC3
5.36.0-RC2
5.35.11
5.35.10
5.35.9
5.35.8
5.35.7
5.35.6
5.35.5
5.35.4
5.35.3
5.35.2
5.35.1
5.35.0
5.33.9
5.33.8
5.33.7
5.33.6
5.33.5
5.33.4
5.33.3
5.33.2
5.33.1
5.33.0
Documentation
Perl
Intro
Tutorials
FAQs
Reference
Operators
Functions
Variables
Modules
Utilities
Community
History
Expand
variables
(source,
CPAN)
CONTENTS
GeneralVariables
Variablesrelatedtoregularexpressions
Variablesrelatedtofilehandles
Variablesrelatedtoformats
ErrorVariables
Variablesrelatedtotheinterpreterstate
Deprecatedandremovedvariables
Fulldocumentationofpredefinedvariables:perlvar
#GeneralVariables
$_-Thedefaultinputandpattern-searchingspace
@_-Withinasubroutinethearray@_containstheparameterspassedtothatsubroutine
$"-Whenanarrayoranarraysliceisinterpolatedintoadouble-quotedstringorasimilarcontextsuchas/.../,itselementsareseparatedbythisvalue
$$-TheprocessnumberofthePerlrunningthisscript
$0-Containsthenameoftheprogrambeingexecuted
$(-Therealgidofthisprocess
$)-Theeffectivegidofthisprocess
$-Theeffectiveuidofthisprocess
$;-Thesubscriptseparatorformultidimensionalarrayemulation
$a,$b-Specialpackagevariableswhenusingsort(),see"sort"inperlfunc
%ENV-Thehash%ENVcontainsyourcurrentenvironment
$]-Therevision,version,andsubversionofthePerlinterpreter,representedasadecimaloftheform5.XXXYYY,whereXXXistheversion/1e3andYYYisthesubversion/1e6
$^F-Themaximumsystemfiledescriptor,ordinarily2.Systemfiledescriptorsarepassedtoexec()edprocesses,whilehigherfiledescriptorsarenot
@F-Thearray@Fcontainsthefieldsofeachlinereadinwhenautosplitmodeisturnedon
@INC-Thearray@INCcontainsthelistofplacesthatthedoEXPR,require,oruseconstructslookfortheirlibraryfiles
%INC-Thehash%INCcontainsentriesforeachfilenameincludedviathedo,require,oruseoperators
$^I-Thecurrentvalueoftheinplace-editextension
@ISA-Eachpackagecontainsaspecialarraycalled@ISAwhichcontainsalistofthatclass'sparentclasses,ifany
$^M-Perlcanusethecontentsof$^Masanemergencymemorypoolafterdie()ing
$^O-ThenameoftheoperatingsystemunderwhichthiscopyofPerlwasbuilt,asdeterminedduringtheconfigurationprocess
%SIG-Thehash%SIGcontainssignalhandlersforsignals
$^T-Thetimeatwhichtheprogrambeganrunning,insecondssincetheepoch(beginningof1970)
$^V-Therevision,version,andsubversionofthePerlinterpreter,representedasaversionobject
$^X-ThenameusedtoexecutethecurrentcopyofPerl,fromC'sargv[0]or(wheresupported)/proc/self/exe
#Variablesrelatedtoregularexpressions
$($1,$2,...)-Containsthesubpatternfromthecorrespondingsetofcapturingparenthesesfromthelastsuccessfulpatternmatch,notcountingpatternsmatchedinnestedblocksthathavebeenexitedalready
@{^CAPTURE}-Anarraywhichexposesthecontentsofthecapturebuffers,ifany,ofthelastsuccessfulpatternmatch,notcountingpatternsmatchedinnestedblocksthathavebeenexitedalready
$&-Thestringmatchedbythelastsuccessfulpatternmatch(notcountinganymatcheshiddenwithinaBLOCKoreval()enclosedbythecurrentBLOCK)
${^MATCH}-Thisissimilarto$&($MATCH)exceptthatitdoesnotincurtheperformancepenaltyassociatedwiththatvariable
$`-Thestringprecedingwhateverwasmatchedbythelastsuccessfulpatternmatch,notcountinganymatcheshiddenwithinaBLOCKorevalenclosedbythecurrentBLOCK
${^PREMATCH}-Thisissimilarto$`($PREMATCH)exceptthatitdoesnotincurtheperformancepenaltyassociatedwiththatvariable
$'-Thestringfollowingwhateverwasmatchedbythelastsuccessfulpatternmatch(notcountinganymatcheshiddenwithinaBLOCKoreval()enclosedbythecurrentBLOCK)
${^POSTMATCH}-Thisissimilarto$'($POSTMATCH)exceptthatitdoesnotincurtheperformancepenaltyassociatedwiththatvariable
$+-Thetextmatchedbythehighestusedcapturegroupofthelastsuccessfulsearchpattern
$^N-Thetextmatchedbytheusedgroupmost-recentlyclosed(i.e.thegroupwiththerightmostclosingparenthesis)ofthelastsuccessfulsearchpattern
@+-Thisarrayholdstheoffsetsoftheendsofthelastsuccessfulsubmatchesinthecurrentlyactivedynamicscope
%+-Similarto@+,the%+hashallowsaccesstothenamedcapturebuffers,shouldtheyexist,inthelastsuccessfulmatchinthecurrentlyactivedynamicscope
@--$-[0]istheoffsetofthestartofthelastsuccessfulmatch
%--Similarto%+,thisvariableallowsaccesstothenamedcapturegroupsinthelastsuccessfulmatchinthecurrentlyactivedynamicscope
$^R-Theresultofevaluationofthelastsuccessful(?{code})regularexpressionassertion(seeperlre)
${^RE_COMPILE_RECURSION_LIMIT}-Thecurrentvaluegivingthemaximumnumberofopenbutunclosedparentheticalgroupstheremaybeatanypointduringaregularexpressioncompilation
${^RE_DEBUG_FLAGS}-Thecurrentvalueoftheregexdebuggingflags
${^RE_TRIE_MAXBUF}-Controlshowcertainregexoptimisationsareappliedandhowmuchmemorytheyutilize
#Variablesrelatedtofilehandles
$ARGV-Containsthenameofthecurrentfilewhenreadingfrom<>
@ARGV-Thearray@ARGVcontainsthecommand-lineargumentsintendedforthescript
ARGV-Thespecialfilehandlethatiteratesovercommand-linefilenamesin@ARGV
ARGVOUT-Thespecialfilehandlethatpointstothecurrentlyopenoutputfilewhendoingedit-in-placeprocessingwith-i
$,-Theoutputfieldseparatorfortheprintoperator
$.-Currentlinenumberforthelastfilehandleaccessed
$/-Theinputrecordseparator,newlinebydefault
$\-Theoutputrecordseparatorfortheprintoperator
$|-Ifsettononzero,forcesaflushrightawayandaftereverywriteorprintonthecurrentlyselectedoutputchannel
${^LAST_FH}-Thisread-onlyvariablecontainsareferencetothelast-readfilehandle
#Variablesrelatedtoformats
$^A-Thecurrentvalueofthewrite()accumulatorforformat()lines
$^L-Whatformatsoutputasaformfeed
$%-Thecurrentpagenumberofthecurrentlyselectedoutputchannel
$--Thenumberoflinesleftonthepageofthecurrentlyselectedoutputchannel
$:-Thecurrentsetofcharactersafterwhichastringmaybebrokentofillcontinuationfields(startingwith^)inaformat
$=-Thecurrentpagelength(printablelines)ofthecurrentlyselectedoutputchannel
$^-Thenameofthecurrenttop-of-pageformatforthecurrentlyselectedoutputchannel
$~-Thenameofthecurrentreportformatforthecurrentlyselectedoutputchannel
#ErrorVariables
${^CHILD_ERROR_NATIVE}-Thenativestatusreturnedbythelastpipeclose,backtick(``)command,successfulcalltowait()orwaitpid(),orfromthesystem()operator
$^E-Errorinformationspecifictothecurrentoperatingsystem
$^S-Currentstateoftheinterpreter
$^W-Thecurrentvalueofthewarningswitch,initiallytrueif-wwasused,falseotherwise,butdirectlymodifiable
${^WARNING_BITS}-Thecurrentsetofwarningchecksenabledbytheusewarningspragma
$!-Whenreferenced,$!retrievesthecurrentvalueoftheCerrnointegervariable
%!-Eachelementof%!hasatruevalueonlyif$!issettothatvalue
$?-Thestatusreturnedbythelastpipeclose,backtick(``)command,successfulcalltowait()orwaitpid(),orfromthesystem()operator
$@-ThePerlerrorfromthelastevaloperator,i.e.thelastexceptionthatwascaught
#Variablesrelatedtotheinterpreterstate
$^C-Thecurrentvalueoftheflagassociatedwiththe-cswitch
$^D-Thecurrentvalueofthedebuggingflags
${^GLOBAL_PHASE}-Thecurrentphaseoftheperlinterpreter
$^H-Thisvariablecontainscompile-timehintsforthePerlinterpreter
%^H-The%^Hhashprovidesthesamescopingsemanticas$^H
${^OPEN}-AninternalvariableusedbyPerlIO
$^P-Theinternalvariablefordebuggingsupport
${^TAINT}-Reflectsiftaintmodeisonoroff
${^SAFE_LOCALES}-Reflectsifsafelocaleoperationsareavailabletothisperl(whenthevalueis1)ornot(thevalueis0)
${^UNICODE}-ReflectscertainUnicodesettingsofPerl
${^UTF8CACHE}-ThisvariablecontrolsthestateoftheinternalUTF-8offsetcachingcode
${^UTF8LOCALE}-ThisvariableindicateswhetheraUTF-8localewasdetectedbyperlatstartup
#Deprecatedandremovedvariables
$#-$#wasavariablethatcouldbeusedtoformatprintednumbers
$*-$*wasavariablethatyoucouldusetoenablemultilinematching
$[-Thisvariablestorestheindexofthefirstelementinanarray,andofthefirstcharacterinasubstring
${^ENCODING}-ItusedtoholdtheobjectreferencetotheEncodeobjectthatwasusedtoconvertthesourcecodetoUnicode
${^WIN32_SLOPPY_STAT}-Thisvariablenolongerhasanyfunction
PerldocBrowserismaintainedbyDanBook(DBOOK).PleasecontacthimviatheGitHubissuetrackeroremailregardinganyissueswiththesiteitself,search,orrenderingofdocumentation.
ThePerldocumentationismaintainedbythePerl5PortersinthedevelopmentofPerl.PleasecontactthemviathePerlissuetracker,themailinglist,orIRCtoreportanyissueswiththecontentsorformatofthedocumentation.