. ! @#ARGV - 1 .. $ARGV[0] ( ). @INC do, require use. %INC do require. - , - . $ENV{} %ENV . . $SIG{} %SIG INT, QUIT, PIPE, ... 'DEFAULT' - . 'IGNORE' - .  * () *  . s// m/ =~ != .. : i - . m - . s - . x - ( ) '/x'. , (?...) (pattern) regexp . V8 (Henry Spencer) . ( ) egrep - : \ - . ^ - . - . '\n' - . $ - | - () () - [] - ( ): * - 0 + - 1 ? - 1 0 {n} - n {n,} - {n,m} - n, m () . '*' {0,} , '+' - {1,} '?' - {0,1}. n m 65536. "" (greedy). . " " '?'. . : *? - 0 +? - 1 ?? - 0 1 {n}? - n {n,}? - n {n,m}? - n m `\` - (-): \t - \n - \r - \A - \v - \a - \e - escape \033 - \x1A - \c[ - control \l - \u - -//- \L - \E \U - -//- \E - \Q - : \w - - '_' \W - - '_' \s - \S - \d - \D - "" . . : \w+ - \d+ - [+-]?\d+ - [+-]?\d+\.?\d* - . . : \b - \B - \A - \Z - \G - m//g (\b) - \w \W. '\b' backspace (). \A \Z - '^' '$' '^' '$' \A \Z . ( ) '\'. '$'. : $+ - $& - $` - $' - : $s = " 1 2 3"; if ($s =~ /(\d+)\D+(\d+)/) { print "$1\n"; # '1' print "$2\n"; # '2' print "$+\n"; # '2' print "$&\n"; # '1 2' print "$`\n"; # ' ' print "$'\n"; # ' 3' }  5 : (?#) - . (?:) - '( )' (?=) - "" . /\w+(?=\t)/ '\t' . : $s = "1+2-3*4"; if ($s =~ /(\d)(?=-)/) # '-' { print "$1\n"; # '2' } else { print " \n";} (?!) - "" . : $s = "1+2-3*4"; if ($s =~ /(\d)(?!\+)/) # '+' { print "$1\n"; # '2' } else { print " \n";} (?ismx) - "" . .  . (regex) 1. . '\'. 2. . 3. () '[]' . '^' - . '-' . a-z , 0-9 - .. 4. , '\' . 5. '|' . 6. "" '\' '\1'.  * *  C. , . . ----- --------------------------- -> - ++ -- ** ! ~ \ + - =~ !~ * / % x + - . << >> - - < > <= >= lt gt le ge - == != <=> eq ne cmp & | ^ && || - .. ?: = += -= *= .. , => - not and or xor  . . , , , . . "". ( print(), ..) (chdir(), ..) , . . . : @i = ('a ','b ', print 'c ', 'd '); print "\n",@i,"\n"; : c d a b 1 print. , . print 'c d' @i print .  '->' ++ . [...] {...} , . , . "".  ++ () -- (). . 1 . . . (, , ) . . : print ++($i = "09"); # "10" print ++($i = "a9"); # "b0" print ++($i = "az"); # "ba" print ++($i = "aZ"); # "bA"  ** ( ) : print 4**2 # 16 print -4**2 # -16 .. -(4**2)  . '!' - '-' - '~' - ( 1) '+' - '\' - ( & )  "" =~ !~ . "" . "" . =~ (pattern - , , ) . $_ . . , . .. . !~ =~ ( ""). "".  . '*' - '/' - '%' - 'x' - . , - . : print '*' x 5; # '*****' print (1,2) x 3; # 121212  . '+' - '-' - '.' - ()  . '<<' - . '>>' - .  . . .  . '<' - '>' - '<=' - '>=' - 'lt' - 'gt' - 'le' - 'ge' -  . '==' true () '!=' - '<=>' - -1 , 0 , 1 . 'eq' - 'ne' - 'cmp' - '<=>'  . '&' - AND '|' - OR '^' - XOR  && (AND) || (OR). '&&' - false, . '||' - true, . , 0 1. .  '..' . . - . 1. .. . . : for $i (1..4) { print "$i "; } : 1 2 3 4 - . '..' . false false. true - true true, - false. '...'. false true. '..' '&&' '||'. flase - , true - 1. . "E0" . : @ = ('a'..'z'); # @ = (0..9); # '?:' . '?' ':' - ':'. : $i = 1; $i > 1 ? print "" : print ""; :  . '=' - "" .. $i += 2; $i = $i + 2; . : **= += -= .= *= /= %= x= &= |= ^= <<= >>= &&= ||= '='.  ',' () , . .  not (). not . '!' .  and (). . '&&' "" . . false - .  or (). . '||' "" . . true - . xor ( ). . .  . : & - . '\'. * - . (TYPE) - .  . , . . . '{}' . ( '()', '[]', '{}', '<>') . ---------- ------ ------------ ---- '' q{} Literal "" qq{} `` qx{} qw{} // m{} s{}{} tr{}{} '$' '@' - .. . : \t \n \r \f \v \b backspace () \a \e escape \034 \x1a \c[ \l \u \L \E \U \E \E \Q \E . . '\Q'. . ?PATERN? // . . . m/PATERN/gimosx /PATERN/gimosx (). true (1) false (''). '=~' '!~' $_ : g - . . i - ( ) m - . o - s - x - . '/' - 'm' . . PATTERN () . $) $| . - /o. . PATERN - . ($1, $2, $3...). $1. : $a = "/usr/local/perl/perl.bin"; # : @dirs . : split('\/') . @dirs =~ m[/(\w*)/(\w*)/(\w*)/(\w*)] 'm[' - . (\w*) - . @dirs ('usr', 'local', 'perl') q// '' . . \' \\ ' \ . : print q#.#; # . print 'O\'K'; # O'K qq// "" . : $var = 13; print "\$var = $var"; : $var = 13 qx// `` . : print `date`; : Thu Nov 14 13:36:49 MSK 1996 qw// - . : print qw/ !/; # ('','','!') : ! : use POSIX qw( setlocale localeconv ) @EXPORT = qw( proc1 var ); s///egimosx . false (0). ( =~ != ) $_ . '/' (') . : e - . g - . i - m - o - s - x - '/' - . : $var = "12345"; # $var =~ s/1/0/; # '1' '0'. 02345 $var =~ s(5)(.); # '5' '.' 0234. . $var =~ s/\d*//; . '.' $var =~ s///g; # '' ''. '.' $var = "12 34"; # $var =~ s/(\d\d) (\d\d)/$2 $1/; # . '34 12'. tr/1/2/cds y/1/2/cds "1" "2". - . =~ != $_. sed tr 'y'. : c - "1" d - . s - "" . /d 2 . 2 1 1 . 2 - null . . : $s = "hello"; # $s =~ tr/a-z/A-Z/; # . # 'HELLO' $s = 'Hel....lo'; $s =~ tr/a-zA-z/_/c; # '_' # 'Hel____lo' $s =~ tr/_/ /s; # '_' ' ' . # 'Hel lo' $s =~ tr/a-zA-Z /a-zA-Z/d; # . 'Hello' 1 .  -. -. '`' - . "" . , - - . $? . '<>'. <> . '' open(). '\n' - , . false. $_. STDIN - . : while(<>) { print; }; # STDIN '<>' . , . . - . : while(<*.pl>) { print;}; # ls *.pl @files = <*>; # @files : @files = glob("*"); .. .  . . '\' , , , .  . , : use integer; , : no integer;  * *  : . ',' - . () , . . . '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 , '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 abs  accept NEWSOCKET, GENERICSOCKET . accept(). false . alarm  SIGALARM . . . atan2 Y, X Y X -pi +pi. bind ,  . bind. true false . - . binmode  (binary) . CR LF LF, LF CR LF. bless ,  bless . . . -. caller  caller . true eval() require() false - . ($package, $filename, $line) $package - $filename - $line - . : ($package, $filename, $line, $subroutine, $hasargs, $wantargs) "" . $subroutine - $hasargs - $wantargs - DB . @DB::args. chdir  . "" . true false - . chmod  . - , . . : chmod 0666 'f1', 'f2', 'f3'; chomp  chomp chomp $/. 'LF'. . $_. . chop  chop chop chomp . chown  "" "" . - , . - , "" . chr  . chroot  "" . "" - '/'. close  . .. open(). closedir  opendir(). connect ,  . connect(). true false . cos  . crypt , salt . crypt(). dbmclose  . dbmopen , ,  . dbm, ndbm, sbdm, gdbm Berkeley DB. () . ( ). AnyDBM(). define  true () false . , , , .. , . . delete  . . $ENV{} - . - . die  eval() STDERR $!. $! 0 ($? >> 8). 0 255. eval() $@ eval() . . '\n' . do BLOCK . . BLOCK . do  . do  . . use() require() . dump  "" . undump . goto . . ! . each  2- . - - . "" . . eof  eof() eof 1 . . . . eof() while(<>) . eof(ARGV) eof . eval  eval . . return. die $@ . $@ . $_. exec  . system(). 1 1 execvp() . /bin/sh -c . execvp() . ! exec() system(0) / $| . exists  true . exit  . exp  e ( ) . fcntl , ,  fcntl(). use Fcntl; fileno  . flock ,  flock() fork fork(). pid 0 - . format . write. . formline ,  format. . $^A write , . format formline , formline . '~' '~~' . getc  getc . STDIN. . getlogin login /etc/utmp "" getpwuid(). getpeername  . getpgrp PID PID. . getppid PID . getpriority WHICH, WHO , .  * *  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