Perl functions A-Z

Home>Language reference> Perl functions A-Z

Perl functions A-Z
Perl functions A-Z|Perl functions by category|The 'perlfunc' manpage
A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y| Z
A
AUTOLOAD
abs- absolute value function
accept- accept an incoming socket connect
alarm- schedule a SIGALRM
and
atan2- arctangent of Y/X in the range -PI to PI

B
BEGIN
bind- binds an address to a socket
binmode- prepare binary files for I/O
bless- create an object
break- break out of a "given" block

C
CHECK
caller- get context of the current subroutine call
chdir- change your current working directory
chmod- changes the permissions on a list of files
chomp- remove a trailing record separator from a string
chop- remove the last character from a string
chown- change the owership on a list of files
chr- get character this number represents
chroot- make directory new root for path lookups
close- close file (or pipe or socket) handle
closedir- close directory handle
cmp
connect- connect to a remote socket
continue- optional trailing block in a while or foreach
cos- cosine function
crypt- one-way passwd-style encryption

D
DESTROY
DATA
dbmclose- breaks binding on a tied dbm file
dbmopen- create binding on a tied dbm file
default
defined- test whether a value, variable, or function is defined
delete- deletes a value from a hash
die- raise an exception or bail out
do- turn a BLOCK into a TERM
dump- create an immediate core dump

E
END
END
each- retrieve the next key/value pair from a hash
else
elseif
elsif
endgrent- be done using group file
endhostent- be done using hosts file
endnetent- be done using networks file
endprotoent- be done using protocols file
endpwent- be done using passwd file
endservent- be done using services file
eof- test a filehandle for its end
eq
eval- catch exceptions or compile and run code
evalbytes
exec- abandon this program to run another
exists- test whether a hash key is present
exit- terminate this program
exp- raise Ito a power

F
FILE
fc
fcntl- file control system call
fileno- return file descriptor from filehandle
flock- lock an entire file with an advisory lock
for
foreach
fork- create a new process just like this one
format- declare a picture format with use by the write() function
formline- internal function used for formats

G
ge
getc- get the next character from the filehandle
getgrent- get next group record
getgrgid- get group record given group user ID
getgrnam- get group record given group name
gethostbyaddr- get host record given its address
gethostbyname- get host record given name
gethostent- get next hosts record
getlogin- return who logged in at this tty
getnetbyaddr- get network record given its address
getnetbyname- get networks record given name
getnetent- get next networks record
getpeername- find the other end of a socket connection
getpgrp- get process group
getppid- get parent process ID
getpriority- get current nice value
getprotobyname- get protocol record given name
getprotobynumber- get protocol record numeric protocol
getprotoent- get next protocols record
getpwent- get next passwd record
getpwnam- get passwd record given user login name
getpwuid- get passwd record given user ID
getservbyname- get services record given its name
getservbyport- get services record given numeric port
getservent- get next services record
getsockname- retrieve the sockaddr for a given socket
getsockopt- get socket options on a given socket
given
glob- expand filenames using wildcards
gmtime- convert UNIX time into record or string using Greenwich time
goto- create spaghetti code
grep- locate elements in a list test true against a given criterion
gt

H
hex- convert a string to a hexadecimal number

I
INIT
if
import- patch a module's namespace into your own
index- find a substring within a string
int- get the integer portion of a number
ioctl- system-dependent device control system call

J
join- join a list into a string using a separator

K
keys- retrieve list of indices from a hash
kill- send a signal to a process or process group

L
LINE
last- exit a block prematurely
lc- return lower-case version of a string
lcfirst- return a string with just the next letter in lower case
le
length- return the number of bytes in a string
link- create a hard link in the filesytem
listen- register your socket as a server
local- create a temporary value for a global variable (dynamic scoping)
localtime- convert UNIX time into record or string using local time
lock- get a thread lock on a variable, subroutine, or method
log- retrieve the natural logarithm for a number
lstat- stat a symbolic link
lt

M
m- match a string with a regular expression pattern
map- apply a change to a list to get back a new list with the changes
mkdir- create a directory
msgctl- SysV IPC message control operations
msgget- get SysV IPC message queue
msgrcv- receive a SysV IPC message from a message queue
msgsnd- send a SysV IPC message to a message queue
my- declare and assign a local variable (lexical scoping)

N
ne
next- iterate a block prematurely
no- unimport some module symbols or semantics at compile time
not

O
oct- convert a string to an octal number
open- open a file, pipe, or descriptor
opendir- open a directory
or
ord- find a character's numeric representation
our- declare and assign a package variable (lexical scoping)

P
PACKAGE
pack- convert a list into a binary representation
package- declare a separate global namespace
pipe- open a pair of connected filehandles
pop- remove the last element from an array and return it
pos- find or set the offset for the last/next m//g search
print- output a list to a filehandle
printf- output a formatted list to a filehandle
prototype- get the prototype (if any) of a subroutine
push- append one or more elements to an array

Q
q- singly quote a string
qq- doubly quote a string
qr- Compile pattern
quotemeta- quote regular expression magic characters
qw- quote a list of words
qx- backquote quote a string

R
rand- retrieve the next pseudorandom number
read- fixed-length buffered input from a filehandle
readdir- get a directory from a directory handle
readline- fetch a record from a file
readlink- determine where a symbolic link is pointing
readpipe- execute a system command and collect standard output
recv- receive a message over a Socket
redo- start this loop iteration over again
ref- find out the type of thing being referenced
rename- change a filename
require- load in external functions from a library at runtime
reset- clear all variables of a given name
return- get out of a function early
reverse- flip a string or a list
rewinddir- reset directory handle
rindex- right-to-left substring search
rmdir- remove a directory

S
SUB
s- replace a pattern with a string
say- print with newline
scalar- force a scalar context
seek- reposition file pointer for random-access I/O
seekdir- reposition directory pointer
select- reset default output or do I/O multiplexing
semctl- SysV semaphore control operations
semget- get set of SysV semaphores
semop- SysV semaphore operations
send- send a message over a socket
setgrent- prepare group file for use
sethostent- prepare hosts file for use
setnetent- prepare networks file for use
setpgrp- set the process group of a process
setpriority- set a process's nice value
setprotoent- prepare protocols file for use
setpwent- prepare passwd file for use
setservent- prepare services file for use
setsockopt- set some socket options
shift- remove the first element of an array, and return it
shmctl- SysV shared memory operations
shmget- get SysV shared memory segment identifier
shmread- read SysV shared memory
shmwrite- write SysV shared memory
shutdown- close down just half of a socket connection
sin- return the sine of a number
sleep- block for some number of seconds
socket- create a socket
socketpair- create a pair of sockets
sort- sort a list of values
splice- add or remove elements anywhere in an array
split- split up a string using a regexp delimiter
sprintf- formatted print into a string
sqrt- square root function
srand- seed the random number generator
stat- get a file's status information
state- declare and assign a state variable (persistent lexical scoping)
study- optimize input data for repeated searches
sub- declare a subroutine, possibly anonymously
substr- get or alter a portion of a stirng
symlink- create a symbolic link to a file
syscall- execute an arbitrary system call
sysopen- open a file, pipe, or descriptor
sysread- fixed-length unbuffered input from a filehandle
sysseek- position I/O pointer on handle used with sysread and syswrite
system- run a separate program
syswrite- fixed-length unbuffered output to a filehandle

T
tell- get current seekpointer on a filehandle
telldir- get current seekpointer on a directory handle
tie- bind a variable to an object class
tied- get a reference to the object underlying a tied variable
time- return number of seconds since 1970
times- return elapsed time for self and child processes
tr- transliterate a string
truncate- shorten a file

U
UNITCHECK
uc- return upper-case version of a string
ucfirst- return a string with just the next letter in upper case
umask- set file creation mode mask
undef- remove a variable or function definition
unless
unlink- remove one link to a file
unpack- convert binary structure into normal perl variables
unshift- prepend more elements to the beginning of a list
untie- break a tie binding to a variable
until
use- load in a module at compile time
utime- set a file's last access and modify times

V
values- return a list of the values in a hash
vec- test or set particular bits in a string

W
wait- wait for any child process to die
waitpid- wait for a particular child process to die
wantarray- get void vs scalar vs list context of current subroutine call
warn- print debugging info
when
while
write- print a picture record

X
-X- a file test (-r, -x, etc)
x
xor

Y
y- transliterate a string

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 206,723评论 6 481
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 88,485评论 2 382
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 152,998评论 0 344
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 55,323评论 1 279
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 64,355评论 5 374
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,079评论 1 285
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,389评论 3 400
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,019评论 0 259
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 43,519评论 1 300
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,971评论 2 325
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,100评论 1 333
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,738评论 4 324
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,293评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,289评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,517评论 1 262
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,547评论 2 354
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,834评论 2 345

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 9,399评论 0 23
  • 我早已被乐乐的拖延和自己的唠叨搞烦了,谁想到我会跟在孩子后面说叨,我其实很烦…… 下定决心不再多说,和乐乐商量好,...
    阳光洒洒阅读 168评论 0 0
  • 0. 引言 在学习进程控制前,先了解进程运行的环境,如:main函数是如何被调用的;命令行参数是如何传递给新程序的...
    伤口不该结疤阅读 1,336评论 0 51
  • 因为身体的原因,请了三天假回来看中医。暂时和预售工作告别了。 昨晚翻来覆去睡不着,两点,三点,四点,每个点都起来一...
    LoveYoga喵喵阅读 274评论 2 1