Perl officially stands for Practical Extraction and Report Language, except when it doesn't. ... Perl was originally a language optimized for ...
Togglenavigation
LinuxCommands
Manpages
Allmanualsections
Section1:UserCommands
Section2:SystemCalls
Section3:CLibraryFunctions
Section4:DevicesandSpecialFiles
Section5:FileFormatsandConventions
Section6:Gameset.al.
Section7:Miscellanea
Section8:SystemAdministrationtoolsandDaemons
Blog
PERL
Section:PerlProgrammersReferenceGuide(1)Updated:2016-07-22Index
ReturntoMainContents
NAME
perl-ThePerl5languageinterpreter
SYNOPSIS
perl [ -sTtuUWX ]
[ -hv ] [ -V[:configvar] ]
[ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ]
[ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/hexadecimal] ]
[ -Idir ] [ -m[-]module ] [ -M[-]'module...' ] [ -f ]
[ -C [number/list] ]
[ -S ]
[ -x[dir] ]
[ -i[extension] ]
[ [-e|-E] 'command' ] [ -- ] [ programfile ] [ argument ]...
Formoreinformationontheseoptions,youcanrun"perldocperlrun".
GETTINGHELP
Theperldocprogramgivesyouaccesstoallthedocumentationthatcomes
withPerl.Youcangetmoredocumentation,tutorialsandcommunitysupport
onlineat.
Ifyou'renewtoPerl,youshouldstartbyrunning"perldocperlintro",
whichisageneralintroforbeginnersandprovidessomebackgroundtohelp
younavigatetherestofPerl'sextensivedocumentation.Run"perldoc
perldoc"tolearnmorethingsyoucandowithperldoc.
Foreaseofaccess,thePerlmanualhasbeensplitupintoseveralsections.
Overview
perlPerloverview(thissection)
perlintroPerlintroductionforbeginners
perlrunPerlexecutionandoptions
perltocPerldocumentationtableofcontents
Tutorials
perlreftutPerlreferencesshortintroduction
perldscPerldatastructuresintro
perllolPerldatastructures:arraysofarrays
perlrequickPerlregularexpressionsquickstart
perlretutPerlregularexpressionstutorial
perlootutPerlOOtutorialforbeginners
perlperfPerlPerformanceandOptimizationTechniques
perlstylePerlstyleguide
perlcheatPerlcheatsheet
perltrapPerltrapsfortheunwary
perldebtutPerldebuggingtutorial
perlfaqPerlfrequentlyaskedquestions
perlfaq1GeneralQuestionsAboutPerl
perlfaq2ObtainingandLearningaboutPerl
perlfaq3ProgrammingTools
perlfaq4DataManipulation
perlfaq5FilesandFormats
perlfaq6Regexes
perlfaq7PerlLanguageIssues
perlfaq8SystemInteraction
perlfaq9Networking
ReferenceManual
perlsynPerlsyntax
perldataPerldatastructures
perlopPerloperatorsandprecedence
perlsubPerlsubroutines
perlfuncPerlbuilt-infunctions
perlopentutPerlopen()tutorial
perlpacktutPerlpack()andunpack()tutorial
perlpodPerlplainolddocumentation
perlpodspecPerlplainolddocumentationformatspecification
perlpodstylePerlPODstyleguide
perldiagPerldiagnosticmessages
perllexwarnPerlwarningsandtheircontrol
perldebugPerldebugging
perlvarPerlpredefinedvariables
perlrePerlregularexpressions,therestofthestory
perlrebackslashPerlregularexpressionbackslashsequences
perlrecharclassPerlregularexpressioncharacterclasses
perlrerefPerlregularexpressionsquickreference
perlrefPerlreferences,therestofthestory
perlformPerlformats
perlobjPerlobjects
perltiePerlobjectshiddenbehindsimplevariables
perldbmfilterPerlDBMfilters
perlipcPerlinterprocesscommunication
perlforkPerlfork()information
perlnumberPerlnumbersemantics
perlthrtutPerlthreadstutorial
perlportPerlportabilityguide
perllocalePerllocalesupport
perluniintroPerlUnicodeintroduction
perlunicodePerlUnicodesupport
perlunicookPerlUnicodecookbook
perlunifaqPerlUnicodeFAQ
perlunipropsIndexofUnicodepropertiesinPerl
perlunitutPerlUnicodetutorial
perlebcdicConsiderationsforrunningPerlonEBCDICplatforms
perlsecPerlsecurity
perlmodPerlmodules:howtheywork
perlmodlibPerlmodules:howtowriteanduse
perlmodstylePerlmodules:howtowritemoduleswithstyle
perlmodinstallPerlmodules:howtoinstallfromCPAN
perlnewmodPerlmodules:preparinganewmodulefordistribution
perlpragmaPerlmodules:writingauserpragma
perlutilutilitiespackagedwiththePerldistribution
perlfilterPerlsourcefilters
perldtracePerl'ssupportforDTrace
perlglossaryPerlGlossary
InternalsandCLanguageInterface
perlembedPerlwaystoembedperlinyourCorC++application
perldebgutsPerldebugginggutsandtips
perlxstutPerlXStutorial
perlxsPerlXSapplicationprogramminginterface
perlxstypemapPerlXSC/Perltypeconversiontools
perlclibInternalreplacementsforstandardClibraryfunctions
perlgutsPerlinternalfunctionsforthosedoingextensions
perlcallPerlcallingconventionsfromC
perlmroapiPerlmethodresolutionplugininterface
perlreapiPerlregularexpressionplugininterface
perlregutsPerlregularexpressionengineinternals
perlapiPerlAPIlisting(autogenerated)
perlinternPerlinternalfunctions(autogenerated)
perliolCAPIforPerl'simplementationofIOinLayers
perlapioPerlinternalIOabstractioninterface
perlhackPerlhackersguide
perlsourceGuidetothePerlsourcetree
perlinterpOverviewofthePerlinterpretersourceandhowitworks
perlhacktutWalkthroughthecreationofasimpleCcodepatch
perlhacktipsTipsforPerlcoreCcodehacking
perlpolicyPerldevelopmentpolicies
perlgitUsinggitwiththePerlrepository
Miscellaneous
perlbookPerlbookinformation
perlcommunityPerlcommunityinformation
perldocLookupPerldocumentationinPodformat
perlhistPerlhistoryrecords
perldeltaPerlchangessincepreviousversion
perl5201deltaPerlchangesinversion5.20.1
perl5200deltaPerlchangesinversion5.20.0
perl5184deltaPerlchangesinversion5.18.4
perl5182deltaPerlchangesinversion5.18.2
perl5181deltaPerlchangesinversion5.18.1
perl5180deltaPerlchangesinversion5.18.0
perl5163deltaPerlchangesinversion5.16.3
perl5162deltaPerlchangesinversion5.16.2
perl5161deltaPerlchangesinversion5.16.1
perl5160deltaPerlchangesinversion5.16.0
perl5144deltaPerlchangesinversion5.14.4
perl5143deltaPerlchangesinversion5.14.3
perl5142deltaPerlchangesinversion5.14.2
perl5141deltaPerlchangesinversion5.14.1
perl5140deltaPerlchangesinversion5.14.0
perl5125deltaPerlchangesinversion5.12.5
perl5124deltaPerlchangesinversion5.12.4
perl5123deltaPerlchangesinversion5.12.3
perl5122deltaPerlchangesinversion5.12.2
perl5121deltaPerlchangesinversion5.12.1
perl5120deltaPerlchangesinversion5.12.0
perl5101deltaPerlchangesinversion5.10.1
perl5100deltaPerlchangesinversion5.10.0
perl589deltaPerlchangesinversion5.8.9
perl588deltaPerlchangesinversion5.8.8
perl587deltaPerlchangesinversion5.8.7
perl586deltaPerlchangesinversion5.8.6
perl585deltaPerlchangesinversion5.8.5
perl584deltaPerlchangesinversion5.8.4
perl583deltaPerlchangesinversion5.8.3
perl582deltaPerlchangesinversion5.8.2
perl581deltaPerlchangesinversion5.8.1
perl58deltaPerlchangesinversion5.8.0
perl561deltaPerlchangesinversion5.6.1
perl56deltaPerlchangesinversion5.6
perl5005deltaPerlchangesinversion5.005
perl5004deltaPerlchangesinversion5.004
perlexperimentAlistingofexperimentalfeaturesinPerl
perlartisticPerlArtisticLicense
perlgplGNUGeneralPublicLicense
Language-Specific
perlcnPerlforSimplifiedChinese(inEUC-CN)
perljpPerlforJapanese(inEUC-JP)
perlkoPerlforKorean(inEUC-KR)
perltwPerlforTraditionalChinese(inBig5)
Platform-Specific
perlaixPerlnotesforAIX
perlamigaPerlnotesforAmigaOS
perlandroidPerlnotesforAndroid
perlbs2000PerlnotesforPOSIX-BCBS2000
perlcePerlnotesforWinCE
perlcygwinPerlnotesforCygwin
perldosPerlnotesforDOS
perlfreebsdPerlnotesforFreeBSD
perlhaikuPerlnotesforHaiku
perlhpuxPerlnotesforHP-UX
perlhurdPerlnotesforHurd
perlirixPerlnotesforIrix
perllinuxPerlnotesforLinux
perlmacosPerlnotesforMacOS(Classic)
perlmacosxPerlnotesforMacOSX
perlnetwarePerlnotesforNetWare
perlopenbsdPerlnotesforOpenBSD
perlos2PerlnotesforOS/2
perlos390PerlnotesforOS/390
perlos400PerlnotesforOS/400
perlplan9PerlnotesforPlan9
perlqnxPerlnotesforQNX
perlriscosPerlnotesforRISCOS
perlsolarisPerlnotesforSolaris
perlsymbianPerlnotesforSymbian
perlsynologyPerlnotesforSynology
perltru64PerlnotesforTru64
perlvmsPerlnotesforVMS
perlvosPerlnotesforStratusVOS
perlwin32PerlnotesforWindows
StubsforDeletedDocuments
perlboot
perlbot
perlrepository
perltodo
perltooc
perltoot
OnDebiansystems,youneedtoinstalltheperl-docpackagewhich
containsthemajorityofthestandardPerldocumentationandthe
perldocprogram.
ExtensiveadditionaldocumentationforPerlmodulesisavailable,both
thosedistributedwithPerlandthird-partymoduleswhicharepackaged
orlocallyinstalled.
YoushouldbeabletoviewPerl'sdocumentationwithyourman(1)
programorperldoc(1).
Somedocumentationisnotavailableasmanpages,soifa
cross-referenceisnotfoundbyman,tryitwithperldoc.Perldoccan
alsotakeyoudirectlytodocumentationforfunctions(withthe-f
switch).See"perldoc--help"(or"perldocperldoc"or"manperldoc")
forotherhelpfuloptionsperldochastooffer.
Ingeneral,ifsomethingstrangehasgonewrongwithyourprogramandyou're
notsurewhereyoushouldlookforhelp,trymakingyourcodecomplywith
usestrictandusewarnings.Thesewilloftenpointoutexactly
wherethetroubleis.
DESCRIPTION
PerlofficiallystandsforPracticalExtractionandReportLanguage,
exceptwhenitdoesn't.
Perlwasoriginallyalanguageoptimizedforscanningarbitrary
textfiles,extractinginformationfromthosetextfiles,andprinting
reportsbasedonthatinformation.Itquicklybecameagoodlanguage
formanysystemmanagementtasks.Overtheyears,Perlhasgrowninto
ageneral-purposeprogramminglanguage.It'swidelyusedforeverything
fromquick``one-liners''tofull-scaleapplicationdevelopment.
Thelanguageisintendedtobepractical(easytouse,efficient,
complete)ratherthanbeautiful(tiny,elegant,minimal).Itcombines
(intheauthor'sopinion,anyway)someofthebestfeaturesofsed,
awk,andsh,makingitfamiliarandeasytouseforUnixusersto
whipupquicksolutionstoannoyingproblems.Itsgeneral-purpose
programmingfacilitiessupportprocedural,functional,and
object-orientedprogrammingparadigms,makingPerlacomfortable
languageforthelonghaulonmajorprojects,whateveryourbent.
Perl'srootsintextprocessinghaven'tbeenforgottenovertheyears.
Itstillboastssomeofthemostpowerfulregularexpressionstobe
foundanywhere,anditssupportforUnicodetextisworld-class.It
handlesallkindsofstructuredtext,too,throughanextensive
collectionofextensions.Thoselibraries,collectedintheCPAN,
provideready-madesolutionstoanastoundingarrayofproblems.When
theyhaven'tsetthestandardthemselves,theystealfromthebest
---justlikePerlitself.
AVAILABILITY
Perlisavailableformostoperatingsystems,includingvirtually
allUnix-likeplatforms.See``SupportedPlatforms''inperlport
foralisting.
ENVIRONMENT
Seeperlrun.
AUTHOR
LarryWall,withthehelpofoodlesofotherfolks.
IfyourPerlsuccessstoriesandtestimonialsmaybeofhelptoothers
whowishtoadvocatetheuseofPerlintheirapplications,
orifyouwishtosimplyexpressyourgratitudetoLarryandthe
Perldevelopers,[email protected].
FILES
"@INC"locationsofperllibraries
SEEALSO
http://www.perl.org/thePerlhomepage
http://www.perl.com/Perlarticles(O'Reilly)
http://www.cpan.org/theComprehensivePerlArchive
http://www.pm.org/thePerlMongers
DIAGNOSTICS
Usingthe"usestrict"pragmaensuresthatallvariablesareproperly
declaredandpreventsothermisusesoflegacyPerlfeatures.
The"usewarnings"pragmaproducessomelovelydiagnostics.Onecan
alsousethe-wflag,butitsuseisnormallydiscouraged,because
itgetsappliedtoallexecutedPerlcode,includingthatnotunder
yourcontrol.
SeeperldiagforexplanationsofallPerl'sdiagnostics.The"use
diagnostics"pragmaautomaticallyturnsPerl'snormallytersewarnings
anderrorsintotheselongerforms.
Compilationerrorswilltellyouthelinenumberoftheerror,withan
indicationofthenexttokenortokentypethatwastobeexamined.
(InascriptpassedtoPerlvia-eswitches,each
-eiscountedasoneline.)
Setuidscriptshaveadditionalconstraintsthatcanproduceerror
messagessuchas``Insecuredependency''.Seeperlsec.
Didwementionthatyoushoulddefinitelyconsiderusingtheusewarnings
pragma?
BUGS
Thebehaviorimpliedbytheusewarningspragmaisnotmandatory.
Perlisatthemercyofyourmachine'sdefinitionsofvarious
operationssuchastypecasting,atof(),andfloating-point
outputwithsprintf().
Ifyourstdiorequiresaseekoreofbetweenreadsandwritesona
particularstream,sodoesPerl.(Thisdoesn'tapplytosysread()
andsyswrite().)
Whilenoneofthebuilt-indatatypeshaveanyarbitrarysizelimits
(apartfrommemorysize),therearestillafewarbitrarylimits:a
givenvariablenamemaynotbelongerthan251characters.Linenumbers
displayedbydiagnosticsareinternallystoredasshortintegers,
sotheyarelimitedtoamaximumof65535(highernumbersusuallybeing
affectedbywraparound).
Youmaymailyourbugreports(besuretoincludefullconfiguration
informationasoutputbythemyconfigprogramintheperlsource
tree,orby"perl-V")[email protected]'vesucceeded
incompilingperl,theperlbugscriptintheutils/subdirectory
canbeusedtohelpmailinabugreport.
PerlactuallystandsforPathologicallyEclecticRubbishLister,but
don'ttellanyoneIsaidthat.
NOTES
ThePerlmottois``There'smorethanonewaytodoit.''Divining
howmanymoreisleftasanexercisetothereader.
ThethreeprincipalvirtuesofaprogrammerareLaziness,
Impatience,andHubris.SeetheCamelBookforwhy.
Index
NAME
SYNOPSIS
GETTINGHELP
Overview
Tutorials
ReferenceManual
InternalsandCLanguageInterface
Miscellaneous
Language-Specific
Platform-Specific
StubsforDeletedDocuments
DESCRIPTION
AVAILABILITY
ENVIRONMENT
AUTHOR
FILES
SEEALSO
DIAGNOSTICS
BUGS
NOTES