CARVIEW |
CONTENTS
Full documentation of builtin functions: perlfunc
#Perl Functions by Category
Here are Perl's functions (including things that look like functions, like some keywords and named operators) arranged by category. Some functions appear in more than one place. Any warnings, including those produced by keywords, are described in perldiag and warnings.
- #Functions for SCALARs or strings
-
chomp
,chop
,chr
,crypt
,fc
,hex
,index
,lc
,lcfirst
,length
,oct
,ord
,pack
,q//
,qq//
,reverse
,rindex
,sprintf
,substr
,tr///
,uc
,ucfirst
,y///
fc
is available only if the"fc"
feature is enabled or if it is prefixed withCORE::
. The"fc"
feature is enabled automatically with ause v5.16
(or higher) declaration in the current scope. - #Regular expressions and pattern matching
- #Numeric functions
-
abs
,atan2
,cos
,exp
,hex
,int
,log
,oct
,rand
,sin
,sqrt
,srand
- #Functions for real @ARRAYs
- #Functions for list data
- #Functions for real %HASHes
- #Input and output functions
-
binmode
,close
,closedir
,dbmclose
,dbmopen
,die
,eof
,fileno
,flock
,format
,getc
,print
,printf
,read
,readdir
,readline
,rewinddir
,say
,seek
,seekdir
,select
,syscall
,sysread
,sysseek
,syswrite
,tell
,telldir
,truncate
,warn
,write
say
is available only if the"say"
feature is enabled or if it is prefixed withCORE::
. The"say"
feature is enabled automatically with ause v5.10
(or higher) declaration in the current scope. - #Functions for fixed-length data or records
-
pack
,read
,syscall
,sysread
,sysseek
,syswrite
,unpack
,vec
- #Functions for filehandles, files, or directories
-
-X
,chdir
,chmod
,chown
,chroot
,fcntl
,glob
,ioctl
,link
,lstat
,mkdir
,open
,opendir
,readlink
,rename
,rmdir
,select
,stat
,symlink
,sysopen
,umask
,unlink
,utime
- #Keywords related to the control flow of your Perl program
-
break
,caller
,continue
,die
,do
,dump
,eval
,evalbytes
,exit
,__FILE__
,goto
,last
,__LINE__
,method
,next
,__PACKAGE__
,redo
,return
,sub
,__SUB__
,wantarray
break
is available only if you enable the experimental"switch"
feature or use theCORE::
prefix. The"switch"
feature also enables thedefault
,given
andwhen
statements, which are documented in "Switch Statements" in perlsyn. The"switch"
feature is enabled automatically with ause v5.10
(or higher) declaration in the current scope. In Perl v5.14 and earlier,continue
required the"switch"
feature, like the other keywords.evalbytes
is only available with the"evalbytes"
feature (see feature) or if prefixed withCORE::
.__SUB__
is only available with the"current_sub"
feature or if prefixed withCORE::
. Both the"evalbytes"
and"current_sub"
features are enabled automatically with ause v5.16
(or higher) declaration in the current scope. - #Keywords related to scoping
-
caller
,class
,field
,import
,local
,my
,our
,package
,state
,use
state
is available only if the"state"
feature is enabled or if it is prefixed withCORE::
. The"state"
feature is enabled automatically with ause v5.10
(or higher) declaration in the current scope. - #Miscellaneous functions
- #Functions for processes and process groups
-
alarm
,exec
,fork
,getpgrp
,getppid
,getpriority
,kill
,pipe
,qx//
,readpipe
,setpgrp
,setpriority
,sleep
,system
,times
,wait
,waitpid
- #Keywords related to Perl modules
- #Keywords related to classes and object-orientation
-
bless
,class
,__CLASS__
,dbmclose
,dbmopen
,field
,method
,package
,ref
,tie
,tied
,untie
,use
- #Low-level socket functions
-
accept
,bind
,connect
,getpeername
,getsockname
,getsockopt
,listen
,recv
,send
,setsockopt
,shutdown
,socket
,socketpair
- #System V interprocess communication functions
-
msgctl
,msgget
,msgrcv
,msgsnd
,semctl
,semget
,semop
,shmctl
,shmget
,shmread
,shmwrite
- #Fetching user and group info
-
endgrent
,endhostent
,endnetent
,endpwent
,getgrent
,getgrgid
,getgrnam
,getlogin
,getpwent
,getpwnam
,getpwuid
,setgrent
,setpwent
- #Fetching network info
-
endprotoent
,endservent
,gethostbyaddr
,gethostbyname
,gethostent
,getnetbyaddr
,getnetbyname
,getnetent
,getprotobyname
,getprotobynumber
,getprotoent
,getservbyname
,getservbyport
,getservent
,sethostent
,setnetent
,setprotoent
,setservent
- #Time-related functions
- #Non-function keywords
-
ADJUST
,and
,AUTOLOAD
,BEGIN
,catch
,CHECK
,cmp
,CORE
,__DATA__
,default
,defer
,DESTROY
,else
,elseif
,elsif
,END
,__END__
,eq
,finally
,for
,foreach
,ge
,given
,gt
,if
,INIT
,isa
,le
,lt
,ne
,not
,or
,try
,UNITCHECK
,unless
,until
,when
,while
,x
,xor
#Alphabetical Listing of Perl Functions
-X
- a file test (-r, -x, etc)__CLASS__
- the class name of the current instance.__FILE__
- the name of the current source file__LINE__
- the current source line number__PACKAGE__
- the current package__SUB__
- the current subroutine, orundef
if not in a subroutineabs
- absolute value functionaccept
- accept an incoming socket connectalarm
- schedule a SIGALRMall
- test if every value in a list satisfies the given conditionany
- test if at least one value in a list satisfies the given conditionatan2
- arctangent of Y/X in the range -PI to PIbind
- binds an address to a socketbinmode
- prepare binary files for I/Obless
- create an objectcaller
- get context of the current subroutine callchdir
- change your current working directorychmod
- changes the permissions on a list of fileschomp
- remove a trailing record separator from a stringchop
- remove the last character from a stringchown
- change the ownership on a list of fileschr
- get character this number representschroot
- make directory new root for path lookupsclass
- declare a separate global namespace that is an object classclose
- close file (or pipe or socket) handleclosedir
- close directory handleconnect
- connect to a remote socketcontinue
- optional trailing block in a while or foreachcos
- cosine functioncrypt
- one-way passwd-style encryptiondbmclose
- breaks binding on a tied dbm filedbmopen
- create binding on a tied dbm filedefined
- test whether a value, variable, or function is defineddelete
- deletes a value from a hashdie
- raise an exception or bail outdo
- turn a BLOCK into a TERMdump
- create an immediate core dumpeach
- retrieve the next key/value pair from a hash or index/value from an arrayendgrent
- be done using group fileendhostent
- be done using hosts fileendnetent
- be done using networks fileendprotoent
- be done using protocols fileendpwent
- be done using passwd fileendservent
- be done using services fileeof
- test a filehandle for its endeval
- catch exceptions or compile and run codeevalbytes
- similar to string eval, but intend to parse a bytestreamexec
- abandon this program to run anotherexists
- test whether a hash key is presentexit
- terminate this programexp
- raise e to a powerfc
- return casefolded version of a stringfcntl
- file control system callfield
- declare a field variable of the current classfileno
- return file descriptor from filehandleflock
- lock an entire file with an advisory lockfork
- create a new process just like this oneformat
- declare a picture format with use by the write() functionformline
- internal function used for formatsgetc
- get the next character from the filehandlegetgrent
- get next group recordgetgrgid
- get group record given group user IDgetgrnam
- get group record given group namegethostbyaddr
- get host record given its addressgethostbyname
- get host record given namegethostent
- get next hosts recordgetlogin
- return who logged in at this ttygetnetbyaddr
- get network record given its addressgetnetbyname
- get networks record given namegetnetent
- get next networks recordgetpeername
- find the other end of a socket connectiongetpgrp
- get process groupgetppid
- get parent process IDgetpriority
- get current nice valuegetprotobyname
- get protocol record given namegetprotobynumber
- get protocol record numeric protocolgetprotoent
- get next protocols recordgetpwent
- get next passwd recordgetpwnam
- get passwd record given user login namegetpwuid
- get passwd record given user IDgetservbyname
- get services record given its namegetservbyport
- get services record given numeric portgetservent
- get next services recordgetsockname
- retrieve the sockaddr for a given socketgetsockopt
- get socket options on a given socketglob
- expand filenames using wildcardsgmtime
- convert UNIX time into record or string using Greenwich timegoto
- create spaghetti codegrep
- locate elements in a list test true against a given criterionhex
- convert a hexadecimal string to a numberimport
- patch a module's namespace into your ownindex
- find a substring within a stringint
- get the integer portion of a numberioctl
- system-dependent device control system calljoin
- join a list into a string using a separatorkeys
- retrieve list of indices from a hash or arraykill
- send a signal to a process or process grouplast
- exit a block prematurelylc
- return lower-case version of a stringlcfirst
- return a string with just the next letter in lower caselength
- return the number of characters in a stringlink
- create a hard link in the filesystemlisten
- register your socket as a serverlocal
- create a temporary value for a global variable (dynamic scoping)localtime
- convert UNIX time into record or string using local timelock
- get a thread lock on a variable, subroutine, or methodlog
- retrieve the natural logarithm for a numberlstat
- stat a symbolic linkm//
- match a string with a regular expression patternmap
- apply a change to a list to get back a new list with the changesmethod
- declare a method of a classmkdir
- create a directorymsgctl
- SysV IPC message control operationsmsgget
- get SysV IPC message queuemsgrcv
- receive a SysV IPC message from a message queuemsgsnd
- send a SysV IPC message to a message queuemy
- declare and assign a local variable (lexical scoping)next
- iterate a block prematurelyno
- unimport some module symbols or semantics at compile timeoct
- convert a string to an octal numberopen
- open a file, pipe, or descriptoropendir
- open a directoryord
- find a character's code pointour
- declare and assign a package variable (lexical scoping)pack
- convert a list into a binary representationpackage
- declare a separate global namespacepipe
- open a pair of connected filehandlespop
- remove the last element from an array and return itpos
- find or set the offset for the last/next m//g searchprint
- output a list to a filehandleprintf
- output a formatted list to a filehandleprototype
- get the prototype (if any) of a subroutinepush
- append one or more elements to an arrayq/STRING/
- singly quote a stringqq/STRING/
- doubly quote a stringqr/STRING/
- compile patternquotemeta
- quote regular expression magic charactersqw/STRING/
- quote a list of wordsqx/STRING/
- backquote quote a stringrand
- retrieve the next pseudorandom numberread
- fixed-length buffered input from a filehandlereaddir
- get a directory from a directory handlereadline
- fetch a record from a filereadlink
- determine where a symbolic link is pointingreadpipe
- execute a system command and collect standard outputrecv
- receive a message over a Socketredo
- start this loop iteration over againref
- find out the type of thing being referencedrename
- change a filenamerequire
- load in external functions from a library at runtimereset
- clear all variables of a given namereturn
- get out of a function earlyreverse
- flip a string or a listrewinddir
- reset directory handlerindex
- right-to-left substring searchrmdir
- remove a directorys///
- replace a pattern with a stringsay
- output a list to a filehandle, appending a newlinescalar
- force a scalar contextseek
- reposition file pointer for random-access I/Oseekdir
- reposition directory pointerselect
- reset default output or do I/O multiplexingsemctl
- SysV semaphore control operationssemget
- get set of SysV semaphoressemop
- SysV semaphore operationssend
- send a message over a socketsetgrent
- prepare group file for usesethostent
- prepare hosts file for usesetnetent
- prepare networks file for usesetpgrp
- set the process group of a processsetpriority
- set a process's nice valuesetprotoent
- prepare protocols file for usesetpwent
- prepare passwd file for usesetservent
- prepare services file for usesetsockopt
- set some socket optionsshift
- remove the first element of an array, and return itshmctl
- SysV shared memory operationsshmget
- get SysV shared memory segment identifiershmread
- read SysV shared memoryshmwrite
- write SysV shared memoryshutdown
- close down just half of a socket connectionsin
- return the sine of a numbersleep
- block for some number of secondssocket
- create a socketsocketpair
- create a pair of socketssort
- sort a list of valuessplice
- add or remove elements anywhere in an arraysplit
- split up a string using a regexp delimitersprintf
- formatted print into a stringsqrt
- square root functionsrand
- seed the random number generatorstat
- get a file's status informationstate
- declare and assign a persistent lexical variablestudy
- no-op, formerly optimized input data for repeated searchessub
- declare a subroutine, possibly anonymouslysubstr
- get or alter a portion of a stringsymlink
- create a symbolic link to a filesyscall
- execute an arbitrary system callsysopen
- open a file, pipe, or descriptorsysread
- fixed-length unbuffered input from a filehandlesysseek
- position I/O pointer on handle used with sysread and syswritesystem
- run a separate programsyswrite
- fixed-length unbuffered output to a filehandletell
- get current seekpointer on a filehandletelldir
- get current seekpointer on a directory handletie
- bind a variable to an object classtied
- get a reference to the object underlying a tied variabletime
- return number of seconds since 1970times
- return elapsed time for self and child processestr///
- transliterate a stringtruncate
- shorten a fileuc
- return upper-case version of a stringucfirst
- return a string with the first letter in upper caseumask
- set file creation mode maskundef
- remove a variable or function definitionunlink
- remove one link to a fileunpack
- convert binary structure into normal perl variablesunshift
- prepend more elements to the beginning of a listuntie
- break a tie binding to a variableuse
- enable Perl language features and declare required versionutime
- set a file's last access and modify timesvalues
- return a list of the values in a hash or arrayvec
- test or set particular bits in a stringwait
- wait for any child process to diewaitpid
- wait for a particular child process to diewantarray
- get void vs scalar vs list context of current subroutine callwarn
- print debugging infowrite
- print a picture recordy///
- transliterate a string
Perldoc Browser is maintained by Dan Book (DBOOK). Please contact him via the GitHub issue tracker or email regarding any issues with the site itself, search, or rendering of documentation.
The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the Perl issue tracker, the mailing list, or IRC to report any issues with the contents or format of the documentation.