:
.
',' - .
() , .
.
.
'LIST'
.
" "
.
.
!
:
print 1 + 2 + 3; # 6
print(1+2)+3; # 3
print (1+2)+3; # 3
print (1+2+3); # 6
- c
.
:
!
.
.
. .
-X
-X
-X
, 'X' .
-
. .
$_. -t STDIN.
1 true '' false
.
. .
'X' :
-r uid/gid
-w -//-
-x -//-
-o uid ( )
-R uid/gid
-W -//-
-X -//-
-O uid
-e
-z
-s
-f
-d
-l
-p pipes ()
-S socket ()
-b
-c -//- -//-
-t - tty
-u setuid
-g -//- setgid
-k -//- sticky
-T
-B
-M ""
-A
-C inode
accept NEWSOCKET, GENERICSOCKET
.
accept(). false
.
SIGALARM
.
.
.
Y X -pi +pi.
.
bind. true false .
- .
(binary) .
CR LF LF,
LF CR LF.
bless
.
. .
-.
caller
.
true
eval() require() false - .
($package, $filename, $line)
$package -
$filename -
$line - .
:
($package, $filename, $line, $subroutine, $hasargs, $wantargs)
"" .
$subroutine -
$hasargs -
$wantargs -
DB
. @DB::args.
.
"" .
true false - .
.
- , .
.
: chmod 0666 'f1', 'f2', 'f3';
chomp
chomp
$/.
'LF'. .
$_.
.
chop
chop
chomp
.
"" "" .
- ,
.
-
,
"" .
.
"" .
"" - '/'.
.
..
open().
opendir().
.
connect(). true
false .
.
. crypt().
.
.
dbm, ndbm, sbdm, gdbm Berkeley DB.
() .
( ).
AnyDBM().
true ()
false .
, ,
, ..
,
.
.
.
.
$ENV{} - .
-
.
eval()
STDERR
$!. $! 0
($? >> 8). 0 255.
eval() $@
eval() .
.
'\n'
.
.
.
BLOCK
.
.
.
.
use() require()
.
"" .
undump
.
goto . .
!
.
2- . -
- .
"" .
.
eof()
eof
1
.
.
.
.
eof()
while(<>)
. eof(ARGV) eof
.
eval
.
.
return.
die $@
. $@
. $_.
.
system().
1 1
execvp() .
/bin/sh -c .
execvp() .
! exec() system(0) /
$|
.
true
.
.
e ( )
.
fcntl().
use Fcntl;
.
flock()
fork(). pid
0 - .
.
write. .
format.
. $^A
write ,
. format
formline , formline
. '~' '~~'
.
getc
.
STDIN.
.
login /etc/utmp
"" getpwuid().
.
PID.
.
PID .
,
.
getpwnam NAME
getgrnam NAME
gethostbyname NAME
getnamebyname NAME
getprotobyname NAME
getpwuid UID
getgrid GID
getservbyname NAME, PROTO
gethostbyaddr ADDR, ADDRTYPE
getnetbyaddr ADDR, ADDRTYPE
getprotobynumber NUMBER
getservbyport PORT, PROTO
getpwent
gethostent
getnetent
getprotoent
getservent
setpwent
setgrent
sethostent STAYOPEN
setnetent STAYOPEN
setprotoent STAYOPEN
setservent STAYOPEN
endpwent
endgrent
endhostent
endnetent
endprotoent
endservent
.
:
($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpw*
($name, $passwd, $gid, $members) = getgr*
($name, $aliases, $addrtype, $length, @addrs) = gethost*
($name, $aliases, $addrtype, $net) = getnet*
($name, $aliases, $proto) = getproto*
($name, $aliases, $port, $proto) = getserv*
-
.
$members getgr
.
@addrs IP .
: ($a, $b, $c, $d) = unpack('C4',$addr[0]);
.
.
'*'
ls.
time()
.
:
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=gmtime(time);
goto
goto &
.
foreach ..
.
:
goto ('1', '2', '3')[$i];
$i = 0 '1', $i = 1 '2' ..
(goto &) ""
.
- .
grep ,
.
$_ .
true.
true.
.
import,
. use().
index ,
.
. 0
$[.
1. -1.
int
.
ioctl FILEHANDLE, FUNCTION, SCALAR
ioctl().
: require "ioctl.ph";
.
.
- .
each .
( )
. .
last
break .
. .
continue .
.
.
.
NEWFILE OLDFILE.
listen().
.
.
my().
9-
time . :
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
.
lstat
stat()
.
. ""
map ,
.
.
.
1 0 .
msgctl() System V
msgget() System V
msgsnd() System V
msgrcv ID, VAR, SIZE, TYPE, FLAGS
msgrcv() System V
.
.
next
continue . .
continue .
- .
.
.
open
. "" -
. ()
.
'<'
( ). '>' - .
'>>' - . '+>' '+<' -
.
'|'
().
'-' - (STDIN), '>-' - (STDOUT).
true false - .
() ">&"
.
'&' '<', '>>', '+>', '+>>' '+<'.
.
"<&=N" N -,
fdopen().
"|-" "-|" "" (fork)
.
(PID) 0 - .
/
/ . /.
$?.
.
readdir(), telldir(), seekdir(), rewinddir() closedir().
true .
ascii .
.
-
.
A - , .
a - , 0 .
b - ( )
B - ( )
h - ( - )
H - ( )
c -
C - .
s - ( ) .
S - .
i - ( ) .
I - .
l - (4 ) .
L - .
n - "" .
N - "" .
v - "VAX" .
V - "VAX" .
f - single float.
F - double float.
p - 0.
P - .
u - uuencode.
x - -
X - .
@ - .
.
'a', 'A', 'b', 'B', 'h' 'H',
.
'*' .
'a' 'A'
- (
'A' , 'a' - ).
'b' 'B' .
'h' 'H' ().
'P' - .
(floats double)
. ,
(double)
'f' .
.
:
print(pack("ccc",65,66,67)); # ABC
print(pack("A4A3","ab","cdefg")); # "ab cde"
print(pack("a4a3","ab","cdefg")); # "ab\0\0cde"
pipe READHANDLE, WRITEHANDLE
pipe().
.
1.
. @ARGV
@_ .
m//g .
print
print
. true
.
STDOUT ( select()).
$_.
select().
print ,
..
. .
-
.
printf
"print sprintf()".
printf() .
.
.
qq//
qx//
qw//
. .
.
rand
0 .
- 0 1.
srand().
read , ,
.
. .
.
opendir().
.
.
.
.
recv SOCKIT, SCALAR, LEN, FLAGS
. recvfrom().
redo
continue.
.
true - false.
.
:
REF, SCALAR, ARRAY, HASH, CODE, GLOB
- .
ref() typeof().
. 1 0.
require
- ,
. -
.
true.
1;
".pm"
,
require use().
reset
continue
.
.
'-'.
.
?? .
.
:
reset 'a'; #
# 'a'
reset 'a-z' # .
: 'A-Z' ..
@ARGV @ENV.
.
.
.
.
readdir().
rindex ,
index ,
. ,
.
.
1 0 . $!
(errno).
.
..
.
.
0 - , 1 -
, 2 - . 1
0 - .
readdir().
telldir().
select
-
.
print write
select.
.
select RBITS, WBITS, EBITS, TIMEOUT
select()
semctl ID, SEMNUM, CMD, ARG
semctl() SYSTEM V.
semget() SYSTEM V.
semop() SYSTEM V.
send SOCKET, MSG, FLAGS, TO
send SOCKET, MSG, FLAGS
. send().
PGRP PID
0 = .
setpriority WHICH, WHO, PRIORITY
PRIORITY WHO
WHICH.
setsockopt SOCKET, LEVEL, OPTNAME, OPTVAL
.
.
shift
.
.
- @ARGV
@_ .
shmctl() System V
shmget() System V
shmread ID, VAR, POS, SIZE
shmread ID, STRING, POS, SIZE
System V.
HOW.
.
sleep
.
SIGALARM. .
socket SOCKET, DOMAIN, TYPE, PROTOCOL
SOCKET.
socketpair SOCKET1, SOCKET2, DOMAIN, TYPE, PROTOCOL
"" DOMAIN.
true false - .
sort
sort
. .
.
,
. .
$main::a $main::b.
.
splice , ,
splice ,
.
. .
.
split //,
split //
split
, , .
,
@_ (
@_ ??)
$_.
.
.
.
.
.
.
:
($a, $b, $) = split(/ /, " ",3);
$a = '', $b = '' $ = ' '
-
,
.
:
@a = split(/([,.])/, ",.");
@a = ("", "," ,"", ".", "")
sprintf() .
.
rand.
.
stat
13
. :
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat($filename);
$dev -
$ino - i-
$mode -
$nlink -
$uid -
$gid -
$rdev -
$size -
$atime -
$mtime -
$ctime -
$blksize -
$blocks - .
'_'
stat().
study
.
.
:
(
$_) .
.
.
substr ,
. .
.
..
. 1 0 - .
. -
- .
.
.
, .
.
.
14 . .
sysread , ,
read().
.
"exec "
fork()
. wait().
256.
syswrite , ,
write().
.
tell
.
.
.
seekdir().
. -
new (TIESCALAR, TIEARRAY TIEHASH).
.
! keys() values()
.
:
TIEHASH classname, LIST
DESTROY this
FETCH this, key
STORE this, key, value
DELETE this, key
EXISTS this, key
FIRSTKEY this
NEXTKEY this, lastkey
:
TIEHASH classname, LIST
DESTROY this
FETCH this, key
STORE this, key, value
[others TBD]
:
TIEHASH classname, LIST
DESTROY this
FETCH this, key
STORE this, key, value
1 1970
00:00:00 UTC. .
4- :
($user, $system, $cuser, $csystem) = times;
:
$user - .
$system - .
$cuser - - .
$csystem - .
tr///
. "".
truncate ,
truncate ,
.
.
.
umask
umask .
.
undef
.
, .
.
.
.
-U.
pack().
.
.
pack().
'%'
. 16 .
tie().
shift.
.
use
.
. .
:
BEGIN { require ; import ; }
.
.
.
.
.
.
.
.
PID -1 .
$?.
PID.
PID -1 .
$?.
true
false - .
STDERR
die(), .
write
write
format. .
- select(),
$~.
.
" "
.
"_TOP".
$^.
$- 0
. "".
. "".
Last-modified: Thu, 24 Apr 1997 17:55:47 GMT