ebook65-1
|
|
|
- 月 张
- 7 years ago
- Views:
Transcription
1 Perl 1Perl 2Perl
2 1P e r l P e r l We b P e r l P e r l P e r l P e r l We b P e r l P e r P e r l H T M L We b P e r l P e r l P e r l P e r l P e r l p e r l p e r l P e r P E R L P e r l Practical Extraction and Report Language P E R L P e r l P e r l P e r Pathologically Eclectic Rubbish Lister P e r l P e r l P e r l 1.1 Perl P e r l P e r l P e r l P e r l
3 4 Perl Perl P e r l P e r U N I X P e r l Windows NT P e r l Windows NT (Resource Kit) P e r l U N I X $ % b a s h % s h e l l P e r l P e r l $ $ perl -v command not found P e r l P e r l P e r l 4. x Perl 4 Perl P e r l Wi n d o w s P e r l 1-1 M S - D O S 1-1 D O S P e r l
4 1Perl 5 C:\> perl -v P e r l 5 D O S Bad command or file name P e r l M a c i n t o s h 1-2 File Find C o m m a m d - f F i n d M a c P e r l P e r l A p p l e About MacPerl Version Patchlevel M a c P e r l 1-2 M a c i n t o s h P e r l Windows 95/98/NT Perl Wi n d o w s P e r l C M a k e f i l e s h e l l P e r P e r 16 P e r l Wi n d o w s P e r l P e r l ActiveState To o l P e r l Wi n d o w s 1-3 P e r l ActiveState Community License A c t i v e S t a t e U R L h t t p :// w w w. A c t i v e S t a t e. c o m P e r l P e r l A c t i v e S t a t e A c t i v e S t a t e P e r l 1-3 A c t i v e S t a t e Wi n d o w s P e r l A c t i v e S t a t e P e r l P e r l A c t i v e S t a t e We b P e r l
5 6 Perl UNIX Perl U N I X P e r l P e r h t t p :// w w w. p e r l. c o m D o w n l o a d s S t a b l e P r o d u c t i o n ANSI C P e r l U N I X P e r l L i n u x S o l a r i s A I X U N I X P e r l P e r l S t a b l e. t a r. g z $ gunzip stable.tar.gz $ tar xf stable.ta r g u n z i p h t t p :// w w w. g n u. o rg g z i p $ sh Configure C o n f i g u r e E n t e r P e r l U N I X $ m a k e P e r l $ make test # make install make test P e r l make install # P e r l make install P e r l $ perl -v U N I X P e r l h t t p :// w w w.perl.com P e r l
6 1Perl Macintosh Perl Macintosh Perl M a c P e r l C PA N h t t p : / / w w w. p e r l. c o m / C PA N / p o r t s / m a c MacPerl appl.bin S t u ffit Expander M a c P e r l P e r l S h u c k M a c P e r l MacOS 8 I n t e r n e t A d v a n c e d - >File Mapping S h u c k. p o d M a c P e r l. p h. p l. p l x. p m. c g i. x s P e r l T E X T MacOS 7 I n t e r n e t C o n f i g I n t e r n e t C o n f i g H e l p e r s p o d s h u c k M a c P e r l M a c P e r l h t t p :// w w w. p e r l. c o m / C PA N / p o r t s / m a c 1.2 P e r l P e r l P e r l Perl FA Q P e r l Wi n d o w s U N I X Pe r l p e r l d o c p e r l d o c p e r l d o c U N I X D O S
7 8 Perl p e r l f u n c P e r l p e r l o p P e r l p e r l f a q Perl FA Q p e r l f u n c perldoc perlfunc perldoc perl - t f p e r l d o c P e r l p r i n t $ perldoc -tf print FA Q P e r l P e r l FA Q FA - q FA Q P e r l $ perldoc -q support FA Q Who Supports Perl? Who develops it? Why is it free? P e r l P e r l U N I X P e r l m a n y e s P e r l m a n P e r l p e r l d o c U N I X m a n $ man perl Microsoft Wi n d o w s A c t i v e S t a t e P e r l H T M L We b We C :\ P e r l \ h t m l M a c i n t o s h M a c P e r l S h u c k M a c P e r l P e r l M a c P e r l S h u c k
8 1Perl p e r l d o c s h e l l p e r l d o c s h e l l PAT H P e r l P e r l P e r l P e r l P e r l P e r We b P e r l h t t p :// w w w. p e r l. c o m P e r l P e r l 1.3 Perl P e r l Microsoft Windows N o t e p a d DOS E D I T. E X E U N I X v i e m a c s p i c o M a c M a c P e r l F i l e N e w P e r l M i c r o s o f t Wo r d Wo r d p a d Wo r d P e r f e c t P e r l P e r l # h e l l o P e r l Wi n d o w s M a c i n t o s h. p l. p l x h e l l o. p l U N I X Microsoft Wi n d o w s M S - D O S
9 10 Perl s h e l l c d h e l l o D O S U N I X C:\PROGRAMS> perl hello P e r l Hello, world! Bad command or file name perl : command not found p e r l p e r l s h e l l PAT H C a n t open perl script hello : A file or directory does not exist P e r l h e l l o h e l l o syntax error P e r l h e l l o U N I X c a t D O S t y p e M a c P e r l S c r i p t R u n h e l l o p e r l M a c P e r l F i l e O p e n M a c P e r l R u n perl hello p e r l p e r l perl P e r l h e l l o ) P e r l perl perl h e l l o Perl H e l l o
10 1Perl 11 #! / u s r / b i n / p e rl P e r l # P e r l # / u s r / b i n / p e r l perl U N I X # U N I X P e r l We b A p a c h e # p e r l # print "Hello,World!\n"; P e r l P e r l p r i n t p r i n t p r i n t P e r l P e r l p r i n t H e l l o, Wo r l d! \ n P e r l \ n P e r l P e r l P e r P e r l pr int Hello Wo r l d! P e r l P e r l P e r Pe r l P e r l p e r l s t y l e
11 12 Perl P e r l P e r Pe r l Perl Journal h t t p :// w w w. tpj. c o m Pe r l Obfuscated Perl Contest 1.4 P e r l P e r l P e r l P e r l P e r P e r l P e r P e r l P e r l Larry Wa l l P e r l P e r U N I X P e r l # p e r l / u s r / b i n / p e r l / u s r / l o c a l / b i n / p e r c h m o d h e l l o U N I X s h e l l chmod 755 hello h e l l o. / h e l l o P e r l U N I X t e s tu N I X s h e l l t e s t t e s s h e l l # P e r l perl programname ) Perl p e r a.
12 1Perl 13 b. c. D O S 2) P e r l a. m i c r o s o f t. c o m b. p e r l. c o m c. p e r l. n e t 3) P e r l a. perlsyn b. perlop c. perlfaq ) b P e r l DOS shell c 2) b 3) a perldoc perl FA Q ( ) FA Q h t t p :// w w w. p e r l. c o m
13 2P e r l P e r l P e r l P e r l P e r l π 15 P e r l P e r l P e r l P e r l P e r 2.1 P e r l P e r l 2-1 P e r l e E - 33 e E 4 _ _ 2 9 6
14 2Perl 15 e P e r l P e r l 8 P e r l 16 2 p e r l d a t a P e r l A S C I I 1 A S C I I P e r l ' ' " " \ P e r l P e r l Go Go ahead,make my d a y P e r l P e r l P e r l P e r l 2-2 P e r l
15 16 Perl 2-2 \ n \ r \ t \ b \ u \ l \\ \' ' ' ' \" " P e r l p e r l d o c Pe r l p e r l o p Quote and Quote-like Operators P e r l q q q q q q q q q q q q q q q < >,{},[] q q q P e r l 2.2 P e r l P e r l
16 2Perl 17 P e r l P e r l a z, A Z _ $ v a l u e $ V A L U E $ V a l u e $ v a l u E P e r l $ _ $$ / $ 2 $ $ P e r l P e r l P e r l P e r l P e r l 0 Perl - w #! - w P e r l P e r l P e r l Use of uninitialized value $_ P e r l $ $ $ _ $ _ $ _ 6 $ _
17 18 Perl 2.3 P e r l P e r l P e r P e r l 2-1 P e r l 1 P e r l - w P e r l 3 50 $ r a d i u s 5 $ r a d i u s * * * 2 $ a r e a 6 $ a r e a 2 54 * $ rj a v as i n $ p i * 8 $ t = 6 P e r l = $ a $ b $ c 42 $ c 42 $ b $ c = $ a $b = 42 $ a $ c o u n t P e r l
18 2Perl P e r l $t 5 $ t $y - $x $ y $ x $e * $pi $ e $ p i $f / 6 $ f 6 24 % * * P e r l. $ a $ b $ a $ H e l l o, World! Nice to meet you $ c $ a $ b P e r l P e r l P e r l $ n a m e J o h n p r i n t I used the variable $name $ n a m e
19 20 Perl P e r l P e r l P e r l $ d a t e $ d a t e d a y x x - x 70 $ l i n e 2.4 P e r l P e r l / * P e r l P e r l P e r l i n t i n t l e n g t h l e n g t h (" n o s e ") 4 l c u c l c ME TO O u c hal 9000 me too l c HAL 9000 c o s c o s r a n d r a n d
20 2Perl 21 1 P e r l p e r l d o c P e r l p e r l o p p e r l f u n c P e r l $ c o u n t e r 1 P e r l < > 5 5 < S T D I N > P e r l < S T D I N >
21 22 Perl 9. 5 < S T D I N > E n t e r $ s i z e < S T D I N > E n t e r c h o m p c h o m p = P e r l P e r l = = $ a = $ a + 3 $ a P e r l P e r l P e r l P e r l
22 2Perl 23 P e r l 0 P e r l P e r l P e r l P e r # - w - P e r l P e r l A rgument x isn t numeric x I n t e r e s t w 3 4 $ p m t 5 $ p m t
23 24 Perl 7 9 $ i n t e r e s t $ m o n s 1 6 $ i n t e r e s t 12 $ i n t e r e s t 1 8 $ t o t a l perl Interest P e r l P e r l p r i n t f 9 P e r l p r i n t f r o u n d P O S I X P e r l Intel UNIX ) q q a. b.
24 2Perl 25 2) $ c $ a = 6 ; $ a + + ; $ b = $ a ; $ b --; $ c = $ b ; a. 6 b. 7 c. 8 3). a. b ) a q q 2) a $ a 6 $ a 7 $ b $ b 6 $ c 3) b P e r l T I M TO W T D I q q $ a $ b $ c) : / p r i n t f i n t
25 3 2 P e r l X P e r l P e r l P e r l 3.1 P e r l
26 3 27 P e r l P e r l P e r l 3.2 if P e r l i f i f T R U E FA L S E $r == 5 = = $ r 5 p r i n t $ r p r i n t i f i f - e l s e e l s e $ r = $ r = = = = =
27 28 Perl i f e x p r e s s i o n 1 B L O C K 1 e l s i f e x p r e s s i o n 2 B L O C K 2 e x p r e s s i o n 1 e x p r e s s i o n 2 B L O C K 3 P e r l = = i f P e r l = = $x == $y $ x $ y > $x > $y $ x $ y < $x < $y $ x $ y >= $x >= $y $ x $ y < = $x <= $y $ x $ y! = $x!= $y $ x $ y 3-1 i f 3-1
28 P e r l - w 3 rand i n t 0 9 $ i m _ t h i n k i n g _ o f 4 ~ 6 $ g u e s s 8 ~ 9 $ g u e s s $ i m _ t h i n k i n g _ o f 1 0 ~ 11 $ g u e s s $ i m _ t h i n k i n g _ o f 1 2 ~ $ f i r s t $ l a s t P e r l 0 i f P e r l i f 0 == 0 = = s i m p l e S i m o n P e r l e q $s eq $t $ s $ t g t $s gt $t $ s $ t l t $s lt $t $ s $ t g e $s ge $t $ s $ t l e $s le $t $ s $ t n e $s ne $t $ s $ t A S C I I 1506 H a p p y H a p p y h a p p y Perl P e r l P e r
29 30 Perl 0 0 u n d e f > x b 0 0 e 00 "" "" " " 0 " 00 " "0.00" i f u n d e f P e r l u n d e f u n d e f 0 i f u n d e f u n d e 0 u n d e f P e r l Use of uninitialized value $ x $ y $ z i f
30 3 31 P e r l && a n d $s && $t $ s $ t $q and $p $ q $ p o r $a $b $ a $ b $c or $d $ c $ d! n o t! $m $ m not $m $ m $ a a n d $ b $ a P r i n t 4 $ d $ o r $ b $ b p r i n t 5 $ d $ d 4 o r $ b 1 o r $ c $ c p r i n t P e r l i f $ a $ b o r $ a $ b o r a n d o r $ m e s s a g e
31 32 Perl o r o o r &&/ a n d / n o t P e r l 5 && while w h i l e w h i l e w h i l e P e r l w h i l e while 1 $ c o u n t e r 0 2 $counter < 10 4 $ c o u n t e r 1 5 } 2 { P e r l w h i l e
32 for f o r P e r l f o r 3 i n i t i a l i z a t i o n t e s t i n c r e m e n t P e r l f o r f o r $ a 0 $ a < 10 $ a = $ a + 2 $ a 2 $ a 10 f o r f o r f o r 3 f o r 3.4 P e r l w h i l e f o r i f P e r l i f i f i f
33 34 Perl P e r l i f i f o r w h i l e i f P e r l l a s t l a s t l a s t $ i 5 w h i l e w h i l e l a s t l a s t $ i $ 3-3 n e x t $ i n e x t $i % 2 $ i 2 p r i n t 2 $ i n e x t
34 P e r l f o r w h i l e M Y B L O C K % P e r l P e r l f o r w h i l e l a s t r e d o n e x t 3-4 f o r 140 i f O U T E R Perl e x i t P e r l e x i t P e r l 11 0 e x i t e x i t e x i P e r l P e r l 3.5 1
35 36 Perl P r i m e s 1 Perl Primes w 3 $ m a x p r i m e s 4 $ v a l u e 5 $ c o u n t 6 w h i l e 7 $ v a l u e 2 8 $ c o m p o s i t e f o r 9 ~ 10 f o r $ v a l u e $ v a l u e ~ 14 $ i $ j $ v a l u e $ v a l u e $ c o m p o s i t e f o r 1 7 ~ 20 f o r $ c o m p o s i t e
36 P e r l i f w h i l e u n t i l f o r P e r l P e r C s w i t c h c a s e P e r l s w i t c h P e r l P e r l s w i t c h s w i t c h perldoc perlsyn P e r l s w i t c h s w i t c f o r w h i l e i f P e r l Unmatched right bracket Missing right bracket {) P e r l P e r l v i E m a c s U l t r a E d i t ) w h i l e a. if (not) {} b. while (! condition ) {} 2) (0 and 5) ( " 0 (" or 0 or " ") and (6 and "H e l l o")) or 1 a. b.
37 38 Perl 3) $i for($i=0; $i<=10; $i++) { } a. 10 b. 9 c ) b while (! condition ) {} 2) a a n d o r o r 3) c $ i < = 10 $ i
38 4 P e r l 50 P e r l $ ab o b $ a B o b P e r l P e F O O P e r l $ n a m e n a m e s $ n a m e n a m e F O n a m e s (5, 'apple', $x ) 4 5 a p p l e $ x π P e r l q w q qw (apples oranges 45.6$x) 4 $ x $ x
39 40 Perl q w ('apples', 'oranges','45.6' '$x') $ x q w $ x $ x x P e r l.. ( ) (1..10, ); ( a.. z ) 26 ( a a.. z z ) 675 a a a b a c a d z x z y z z P e r l P e r l P e r boy=qw(greg Peter b o y s 3 G r e g P e t e r B o b b y q w 6 2 c o p y = o r i g i n a ; c l e a n = ( ) o r i g i n a c o p c o p c l e a n
40 4 k i d g i r l b o y s P e r l G r e g P e t e k i d s M i k e C a r o f a m i l b o y g i r l k i d s ( M i k e C a r o l f a m i l y M i k e C a r o f a m i l peter Bobby Marcia Jan Cindy Mike Carol Alice); ($a, $b, $c)=qw (apples oranges bananas); $ a a p p l e $ s b o r a n g e s $ c b a n a n a s $ a p e a c h e f r u i t $ c $ c u n d e f u n d e f $ t $ u $ v q u a i l $ a $ b $ c $ d $ c g o p h e r $ c u n d e f 4.2 print a r r a y 0 1
41 42 Perl $ a r r a y [ i n d e x ] a r r a y i n d e t r e e s $ $ $ t r e e s [ 3 ] t r e e s P e r l $ t r e e t r e e s [ 0 ] $ t r e e s [ 0 ] P e r t r e e s $ t r e t r e e t r e e s P e r l $ # a r r a y n a m e $ # t r e e s u n d e f $ s i z e a r r a y a r r a y $ s i z e P e r l $ a r r a y [- 1 a r r a y $ a r r a y [- 2 ]
42 l e v e l l e v e l l e v e l l e v e l l e v e l P e r l P e r l P e r l $ a $ b $ a 4 $ b f o o $ a $ b m y d a t a 4 i f 4 i m y d a t a P e r l i f ( v o i d ) 9
43 44 Perl P e r l P r i n t p r i n f o o s c a l a r print acalar f o o S c a l a f o f o f o o p r i n t 2 c h o m p c h o m p 2 c h o m p < S T D I N > P e r l $ a $ a P e r l P e r End of File E O F U N I X C t r l + D M S _ D O S Wi n d o w s C t r l + Z x *
44 4 45 $ l a s t _ p e t $ l a s t _ p e t iguana l o c a l t i m e l o c a l t i m e p r i n t s c a l a r ( l o c a l t i m e ) Thu Sep 16 23:00: l o c a l t i m e l o c a l t i m e $ s e c 0 ~ 59 $ m i n 0 ~ 59 $ h o u r 0 ~ 23 $ m d a y 1 ~ $ m o n 0 ~ 11 $ y e a r _ o ff $ w d a y 0 ~ 6 $ y d a y 0 ~ $ i s d s t 1 9 l o c a l t i m e P e r l
45 46 Perl w h i l e f o r f o r q w Rocky Road $ i n d e x 0 f l a v o r f l a v o r s f l a v o r P e r l P e r l f o r e a c h 3 f o r e a c h $ c o n f l a v o r s $ c o n f l a v o r f l a v o r s f o r e a c h f o r e a c h $ c o n f l a v o r s 2 $ f l a v o r ice cream 3 I d like a bowl of chocolate ice cream v a n i l l a s t r a w b e r r f l a v o r s ice cream P e r l f o r e a c h f o r f o r e a c h () f o r () 3 f o r P e r l
46 4 47 s p l i t S p l i w o r d s T h e q u i c k b r o w n f o x $ _ $ _ $ _ $ _ S p l i t $ _ $ f i r s t c h a r s p l i t 6 s p l i t P e r l s p l i t P e r l j o i n j o i n $ n u m b e r s s p l i t j o i n
47 48 Perl $ m e s s a g e s p l i t j o i n P e r l P e r l s o r t S o r t Bush Carter Clinton Ford Nixon Reagan A S C I I A S C I I s o r t $ a $ b $ b $ a n u m b e r n u m b e r s P e r l < = > c m p 7 P e r l r e v e r s e r e v e r s e r e v e r s e (" P e r l " l r e p r e v e r s e ham and eggs green like not do I
48 4 49 print join(' ', reverse sort l i n e s ); s o r t I a n d d o e g g s g r e e n h a m l i k e n o t j o i n not like ham green egg do and I H a n g m a n perl Hangman 4-1 H a n g m a n
49 50 Perl 1 - w w o r d s 4 ~ g u e s s e w r o n g w o r d s $ c h o i c e r a n w o r d s 4 r a n d h a n g m a n 1 0 $ c h o i c e m y s t e r l e t t e r s 11 h a n g m a h a n g m a n $ h a n g m a n [ 0 ] $ h a n g m a n [ 1 ] 1 b l a n k w o r d (0) x h a n g m a h a n g m a b l a n k w o r d ~ 14 O U T E R h a n g m a n 1 5 ~ 21 f o r e a c b l a n k w o r b l a n k w o r d 2 3 ~ 25 $ w r o n g 1 24 h a n g m a n ~ 27 c h o m p 2 8 ~ g u e s s e s ~ l e t t e r b l a n k w o r b l a n k w o r u n d e f $ r i g h t $ w r o n g 4 0 ~ b l a n k w o r d
50 H a n g m a n 4-2 Hangman s p l i t j o i n f o r e a c h H a n g m a n 4.5 P e r l P e r l P e r l ) $ a $ b a. $a=$b b. $ a $ b = $ b $ a c. $c=$a $ a = $ b $ b = $ c
51 52 Perl 2) $ a = s c a l a a r r a y $ a c ) b $ a c b 2) a $ # a r r a y s c a l a a r r a y H a n g m a n h a n g m a
52 5 P e r l P e r l I / O P e r l P e r l P e r l P e r l P e r l I / O P e r l P e r l 5.1 P e r l P e r ( ) S T D I N P e r l S T D I N 2 P e r l f o r e a c h e l s e i f P e r l p e r l f u n c o p e n o p e n O p e open (filehandle, pathname) o p e n
53 54 Perl c :/ w i n d o w s / s y s t e m / o p e n o p e n 0 o p e u n d e f o p e n i f M Y F I L E e l s e P e r l d i e d i e P e r l s c r i p t n a m e P e r l x x x d i e d i e o p e n o p e n FA L S E O R d i e o p e n T R U E d i e O R o r c l o s e n o v e l. t x t P e r l P e r l Wi n d o w s M S - D O S P e r l \ Wi n d o w s \ u s e r \ p i e r c e \ n o v e l. t x t
54 5 55 \ n P e r l Wi n d o w s M S - D O S / Wi n d o w s D O S U N I X / h o m e / f o o Wi n d o w s c :/ w i n d o w s / w i n. i n i U N I X../ j u n k f i l e Wi n d o w s../ b o b d i r / b o b s f i l e. t x t o p e n Microsoft Wi n d o w s U N C U N C P e r l U N C M a c i n t o s h MacPerl M a c i n t o s h S y s t e m : U t i l s : c o n f i g M y S t u ff : f r i e n d s S h o p p i n g L i s t c o n f i g M y S t u ff f r i e n d s S h o p p i n g L i s t F r e d r i c k P. B r o o k s Mythical Man-Month
55 56 Perl die P e r l d i e d i e d i e at scriptname line xxx P e r l $! $! $! c a n n o t open myfile : a file or directory in the path does not exist $! $! $! $! P e r l w a r n w a r n d i e 5.2 P e r l < >
56 5 57 u n d e f U N I X ASCII 10 D O S Wi n d o w s ASCII P e r l 12 M Y F I L E w h i l e w h i l P e r l $ _ w h i l e $ _ w h i l e P e r l c h o m p M Y F I L c o n t e n t s n o v e l. t x [0] $content [1]
57 58 Perl I am the very model of a modern major-general, w 3 F H d i e s t u ff s t u ff 1 f o r e a c h $ _ f o r e a c h 8 $ _ s c a l a r p r i n t r e v e r s e $ _ s c a l a r r e v e r s e $ _ P e r l P e r l P e r l 5.3 > > P e r l p a t h n a m e f i l e h a n d l > > P e r l
58 5 59 Pe r l Windows 95/98 M a c > > > c l o s e p r i n t p r i n t p r i n f i l e h a n d l e L I S T p r i n t P e r l p r i n t P e r l P e r l No comma allowed after filehandle l o g f i l e p r i n t L O G F p r i n t
59 60 Perl p r i n t < S O U R C E > D E S T 5.4 P e r l P e r l U N I X U N I X P e r l 3 S T D O U T S T D I N S T D E R R P e r l S T D I N p r i n t p r i n S T D O U T 12 p r i n t S T D E R R U N I X S T D E R R d i e w a r n S T D E R R Wi n d o w s D O S S T D E R R S T D O U T U N I X s h e l l U N I X V M S Atari ST Wi n d o w s D O S P e r l
60 5 61 P e r l \ n U N I X \ n ASCII 10 L F M a c i n t o s h \ n ASCII 13 C R D O S Wi n d o w s ASCII 13 ASCII 10 C R L F G I F E X E MS word P e r l b i n m o d e b i n m o d e b i n m o d e U N I X M a c i n t o s h b i n m o d e permission denied P e r l x f i l e h a n d l e p a t h n a m e r - r f i l e f i l e - w -w $a $ a - e - e m y f i l e m y f i l e - z - z d a t a d a t a - s - s d a t a d a t a d a t a - f - f n o v e l. t x t n o v e l. t x t - d - d / t m p / t m p - T - T u n k n o w n u n k n o w n - B - B u n k n o w n u n k n o w n - M - M f o o f o o p e r l d o c p e r l f u n c Alphabetical List of Perl Functions P e r l
61 62 Perl 5.5 p e r l o p e n c l o s e < > r e a d p r i n t b i n m o d e o p e n o p e n o p e n > o p e n die $! ; o p e n d i e c : t a b e m p ( n e w l i n e ) o t e s. t x t o p e n P e r l P e r l o p e n p e r l permission denied P e r l P e r l P e r l g e t c 15 16
62 d a t a a. open F Hd a t aw r i t e b. open F Hd a t a F H c. open F H> d a t a die Cannot open data: $! ; 2 -M $file > 1 and -s $file a. $file b. c. $file c a o p e n b c 2 a - M > 1 - s H a n g m a n
63 6 s p l i t P e r l P e r l P e r l p e r l r e P e r l Mastering Regular Expressions J e ffery E.F. F r i e d l 1997 P e r l T C L J a v a S c r i p t P a t h o n C U N I X P e r l P e r l 6.1 P e r l m // m / s i m o n / S - i - m - o - n S i m o P e r l $ _ P e r l $ _ P e r l $ _ S - i - m - o - n m // $ _
64 6 65 A Z a z m // / m m / C h e e t o s / C h e e t o s / / m P e r l i f R E r e g e x p P e r l
65 66 Perl / p. t /. p o t p a t p i t c a rp e t p yt h o n p u p _ t e n t. a p t p t e x p e c t p t \ n \ r \ t \ f / S i m o n / s S i i m m + + / d o + g /
66 6 67 h o u n dd o g h o td o g d o o gie howser d o o o o o og d o o g b a d g e d o o f u s D o o g i e pagoda ( o ) ( g ) D d d o g + * * 0 / t */ / c a r * t / c a r te d c a t c a r r r t c a r r o t c a r l c a a r t ( o ) ( t ) a 0 / c? o l a / c c o l a o l a o l c * / c? o l a / c o l a o l a c c o l a c / c * o l a / c o l a o l a c c o l a c 0 0 P e r l {} p a t{n, m} n m p a t n m n m / x { 5 10}/ x 5 10 / x { 9 } / x 9 / x { 0 4 }/ x 4 / x { 8 }/ x 8.* / f i r s t.* l a s t / f i r s t l a s t / f i r s t.* l a s t / first then last
67 68 Perl The good players get picked first, the bad last. T h e first shall be last, and the last shall be first. 3 f i r s t l a s t l a s t 4 P e r l p e r l r e ~ 9 Von Beethoven von Beethoven v V P e r l [ ] [ a b c d e ] a b c d e [ a - e ] a b c d e G G g [ 0-9 ] [ 0-9 ] + [ A - Z a - z ]{ 5 } 5 [* # $ %&()] ^ ] ^ - ^ ] /[abc\ ] ]/ - P e r l 6-2
68 \ w [ a - z A - z 0-9 _] \ W \ w \ d [ 0-9 ] \ D \ s [\ t \ f \ r \ n ] \ S d o n t d o g s c a t s f r o g b o g l o g f l o g c l o g / f r o g b o g l o g f l o g c l o g / P e r l o g P e r l /(fr b (f c) ) og/ 1 i s $ f r u i t $ c o l o r 6.2.6
69 70 Perl ^ / ^ v i d e o / v i d e o $ / e a r t h $ / e a r t h, / ^ H e l p / H e l p / ^ F r a n k l y. * d a r n $ / F r a n k l y d a r n / ^ h y s t e r i a $ / h y s t e r i a / ^ $ / / ^ / / $ / 6.3 s /// $ _ searchpattern, r e p l a c e m e n t 0 m i d d l e e n d i n a t i f a p a r t m e n t $ _ / s M o o n 1 perl Moon
70 w 3 ~ 4 $ _ c h o m p c h o m p $ _ 5 / ^ \ s + / $ _ 7 i f 8 ~ 9 / \s* k g s? k i l o g r a m s? / i k g k i l o g r a m s s k g k g $ _ $ _ l b s p o u n d s 1 4 $ _ 1 / $ _ $ _ P e r l $ _
71 72 Perl $ _ $ _ $ $ _ P e r l $ _ $ $ _ P e r l $ _ $ w e i g h t $ _ = ~ = ~ $ _ s /// m // i / m a c b e t h / i ; M a c b e t h M a C b E t H g f 4 f F 4 f i s h f r o g f r e d f o u l g
72 6 73 // g w h i l e W h i l e ( letters ) $ l e t t e r s P e r l P e r l $ 1 $ 2 $ 3 $ 4 / $ 1 $ 2 $ 3 $ 1 $ 2 $ 3 $ grep P e r l P e r l g r e p g r e p g r e p l i s t e x p r e s s i o n b l o c k e x p r e s s i o n b l o c k $ _ g r e d o g s $ _ $ _ / h o u n d / g r e h o u n d s
73 74 Perl $ _ h o u n d s g r e y h o u n d s b l o o d h o u n d s s $ d o g s g r e y h o u n d b l o o d h o u n d s t e r r i e r m u t t c h i h u a h u a P e r l g r e p 8 g r e p U N I X U N I X g r e p U N I X P e r l to grep to grep through a book m a p g r e p m a p $ _ m a words= map {split ' i n p u t $ i n p u w o r d i n p w o r d s 6.6 P e r l / \w \ w + W / m // / /
74 6 75 / m m! p a t t e r n! / d */ * 0 \ d \ d d + / ) x = y a. s/. + =. + / $ 2 = $ 1 / b. s/ * = * / $ 2 = $ 1 / c. s/ * = * / $ 2 $ 1 / 2) $ 2 $ f o o = Star Wars: The Phantom Menace $ f o o = ~ / S t a r \ sw a r sthe Phantom Menace)/ a. $ 2 b. Wa r s c. Wars:The Phantom Menace 3) m / ^ [- + ]?[ 0-9 ] + \.[ 0-9 ]*? $/ a b c ) a c = $ 1 $ 2 = b a 2) a s t a r i $ 1 $ 2 i s t a r b 3) b
75 76 Perl 12 : 00 a m 5 : 00 p m 8 : 30 A M 3 : 00 2 : 60 a m 9 9 : 00 a m 3 : 0 p m 1) 2) 3) 4) 4 t h o ug h t s y ar d s ti c k
76 7 P e r l R o l o d w x I S B N P e r l P e r l P e r l Perl P e r l % % $ a 3 7.1
77 78 Perl % A u t h o r s D u n e Frank Herbert D u n e Frank Herbert $ A u t h o r s { D u n e } $ A u t h o r s {} % A u t h o r s {} % $ P e r l $ A u t h o r s { D u n e } Frank Herbert 4 P e r l = > = P e r l = > 7.2 $
78 7 79 % M o v i e s The Shining K u b r i c k k e y s k e y s $ f i l m keys %Movies $ f i l m $ M o v i e s { $ f i l m } k e y s P e r l v a l u e s k e y D i r e c t o r F i l m s % M o v i e $ D i r e c t o r s [ 0 ] $ F i l m s [ 0 ] r e v e r s e P e r l P e r l
79 80 Perl % B y D i r e c t o r 7.3 P e r D a t a 6 D a t a % M o v i e s % M o v i e s D a t a ; P e r l Perl P e r l % N e w _ H a s h = % O l d _ H a s h ; % O l d _ H a s h P e r l P e r l % N e w _ H a s h % F i r s t % S e c o n d % B o t h % F i r s t % S e c o n d % B o t h % B o t % A d d i t i o n a l
80 P e r l k e y v a l k e y v a k e y v a l u n d e f P e r l e x i s t s e x i s t s u n d e f d e l e t e %Hash=( ) 7.5 P e r l
81 82 Perl $ _ w h i l e $ _ 6 g // \ w 0 [\ w -]* $ 1 $ 1 % Wo r d s P e r l 1 % Wo r d s 1 2 % Wo r d s One Fish Two f i s h w o r d s % s e e n 2 $ _ 3 % s e e n $ _
82 7 83 u n i q u e w o r d s f i s h % s e e n 2 $ _ 3 % s e e n 1 p o l s G r e p $ _ % s e e n $ s e e n { $ _} g r e p $ i n t e r s e c t i o p o l s g r e i n t e r s e c t i o s t a r p o l s % s e e n % s e e d i ff e r e n c s t a r p o l s
83 84 Perl k e y s s o r t 4 s o r t A S C I I s o r t s o r t B L O C K s o r t $ a $ b s o r t $ a $ b % w o r d s $ a $ b % Wo r d s 7.6 Perl P e r l c u s t o m e r s. t e t 7-5 c u s t o m e r 1 perl Customer
84 C u s t o m e r 7-4 Customer 7-5 Customer 1 - w
85 86 Perl 3 P H c u s t o m e r s. t x t 4 ~ 5 P H $ _ $ _ c h o m p 6 $ _ \ s + s p i l t $ n u m b e r $ e m a i l 7 ~ 8 % E m a i l % P h o n e w h i l e w h i l e 1 P e r l l a s t 1 4 ~ ~ ~ 23 g 2 5 ~ n e x t 3 0 ~ 3 3 n e x t 3 4 ~ 3 5 n e x t P e r l P e r l B L O C K w h i l e d o u n t i l 7.7 D B M
86 7 87 j o i n s p l i t 13 p u s h k e y s Ti e :: I x H a s h k e y s 14 D a t a :: D u m p e r S t o r a b l e 15 D B M D B M ) C u s t o m e r n a m e a. P e r l b. c. 2) a. b. c. P e r l 3) a. b. c ) b P e r l
87 88 Perl John Smith Robert Jones 2) a 3) c c C u s t o m e r n a m e C u s t o m e r
88 8 p r i n t r e v e r s e s o r t o p e n c l o s e s p l i t P e r l P e r l Pe r l P e r P e r l P e r l use strict 8.1 P e r l 2 P e r l P e r l P e r l & Y e s n o ( ) ; Y e s n o ( ) ; & & y e s n o &
89 90 Perl P e r l P e r l P e r l r e t u r n P e r l 8 t w o _ b y _ f o u r t w o _ b y _ f o u r r e t u r n r e t u r n
90 x _ g r e a t e r t h a n 100 $ x P e r l g r e p s o r t r e v e r s e p r i n t P e r l P e r $ _[ 0 _ $ $ _ [ 3 ( $ h i t s $ a t _ b a t $ _[ 0 ] $ h i t s $ a t _ b a
91 92 i t e f i r s s e c o f i r s e c o n @ b
92 8 93 $ w e i g h t $ w e i g h t m o o n w e i g h t $ w e i g h t $ w e i g h t P e r l P e r l m y m o o n w e i g h t $ w e i g h t $ w e i g h t $ w e i g h t m o o n w e i g h t $ w e i g h t m y P e r l $! $ _ m y m y f u n c $ x $ x $ $ P e r l P e r
93 94 Perl my M y $ y m y f o r f o r e a c h w h i l e i f m y $ s t u ff % h a s h P e r l f o r f o r e a c h w h i l e i f 8.3 3
94 % 95 % 8-1 s t a t s perl stats 8-1 Stats 1 - w 3 use strict m y 4 ~ 11 f o r e a c h m e a n $ s u m
95 96 Perl 1 2 ~ 21 m e d i a n 2 m e a n $ u p p e r $ l o w e r 2 3 ~ 32 s t d _ d e d a t a $ s q _ d e v _ s u m ~ 35 m y $ d a t a /[\ s,] + / $ d a t d a t a s e t 3 8 ~ 40 m e a n m e d i a n s t d _ d e v s t d _ d e v m e d i a n m e a 8-2 S t a t s 8-2 Stats 8.4 P e r l use strict P e r l local Perl 4 Perl Perl 5 l o c a l $ f o o m y f u n c l o c a l m y e v a l 8-1 m y f u n c $ f o o m y l o c a l
96 my l o c a l $ f o o m y f u n c m e s s _ w i t h _ f o o m e s s _ w i t h _ f o o $ f o o $ f o o m y f u n c 20 m y f u n c $ f o o $ f o o m y f u n c m e s s _ w i t h _ f o o $ f o o 0 $ f o o m y f u n c $ f o o m y f u n c 0 m y m y Perl P e r l P e r l #! P e r l P e r l P e r l - w P e r l use strict use strict P e r l
97 98 Perl m y use strict P e r l m y use strict $ v a r = v a l u e ; v a l u e P e r l use strict use strict A B C D E F f a c t o r i a l $ n u m 3 f a c t o r i a l $ n u m < = 1 f a c t o r i a l r e t u r n $ n u m f a c t o r i a l 1
98 f o r w h i l e f o r e a c h 8.5 P e r l P e r l P e r l & $ f o o f o o p e r l s u b m y $ v a r P e r l syntax error next 2 tokens m y Perl 4 perl -v P e r l 4 13 t y p e g l o b I O :: H a n d l e l o c a l t i m e print "It is now ",1900+ (localtime [5] ) u n d e f (undef, undef, undef, undef, undef, $year_offset )= localtime; 8.6.2
99 100 Perl 1) b a r $ a, $ b $ b a. 5 b. 100 c. 68 2) foo a. 67 b. 68 c. undef 3) f o o $ b a. b. c ) b $ b f o o l o c a l $ b l o c a l m y $ b b a r $ b $ 100 2) b f o o b a r $ a $ bb a r 68 $ a b a r f o o 68 3) b l o c a l
100 P e r l Perl
101 9 P e r l P e r l f o r e a c h j o i n p r i n t p r i n t p r i n t 9.1 p e r l p e r l index Pert index index i n d e x s t r i n g s u b s t r i n g i n d e x s u b s t r i n g o s u b s t r i n g i n d e x - 1 s u b s t r i n g P e r t
102 104 i n d e x 0 i n d e x s o u r c e rindex r i n d e x i n d e x r i n d e x - 1 i n d e x r i n d e x r i n d e l e n g t h ( $ s o u r c e ) - 1 s t a r t 1 i n d e x substr s u b s t r s u b s t r
103 9 105 s u b s t r s t r i n g o ff s e t o ff s e t l e n g t h l e n g t h o ff s e t s u b s t r s u b s t r $ a,- 5 $ a 5 l e n g t h s u b s t r l e n g t h s u b s t r s u b s t r s u b s t r s u b s t r s u b s t r 9.2 s / p a t t e r n / r e p t a c e m e n t / 6 _ t r /// s e a r c h l i s t r e p l a c e m e n t l i s _ A Z A Z r e p l a c e m e n t l i s t s e a r c h l i s t t r ///
104 106 t r /// y /// y t r t r /// y /// s e a r c h l i s t r e p l a c e m e n t l i s t t r /// t r p e r l o p 9.3 print p r i n t P e r l p r i n t f p r i n t f C B A S I C print using p r i n t f f o r m a t s t r i n g l i s t p r i n t f p r i n t l i s t p r i n t f S T D O U T p r i n t p r i n t f f i l e h a n d l e f o r m a t s t r i n g ( ) ( ) f o r m a t s t r i n g f o r m a t s t r i n g - w. d x 9-1 Printf w d c x s w d x f 9-1
105 9 107 perldoc -f printf p r i n t f s p r i n t f p r i n t f s p r i n t f p r i n t f s p r i n t f E m p l o y e e 1 Perl Employee 9 1 E m p l o y e e 9-1 Employee
106 Employee 1 - w 3 use strict m y 5 ~ e m p l o y e e s 2 3 ~ e m p l o y e e s a L 1 F m y 2 5 b L 2 L ~ ~ e m p l o y e e s p r i n t - e m p ()
107 ~ 21 p r i n t - e m p () 1 4 ~ 15 $ _[ 0 ] l a s t f i r s t ~ 20 h o u r s t i m e Klondike Solitaire 7 P e r l p u s h p o p S h i f t u n s h i f t p o p s h i f t t a rg e t _ a r r a y t a rg e t _ a r r A R G V p o p s h i f t
108 110 u n d e f p o p s h i f t u n s h i f t p u A R G V p u s h u n s h i f t n e w _ l i s t t a rg e t _ a r r a y t a rg e r _ a r r a y t a rg e t _ a r r a y p u s h (@ l i s n e w i t e m s l i s t = (@ l i s n e w i t e m s ) P e r l p u s h s h i f t u n s h i f t p u p 0 s p l i c e s p l i c e s p l i c e o ff s e t o ff s e t l e n g t h l e n g t h l i s t l e n g t h l i s t 9.6
109 9 111 i n d e x r i n d e x t r /// s u b s t r p r i n t f s p r i n t f P e r l s u b s t r i n d e x r i n d e x i n d e x r i n d e x s u b s t r P e r l s u b s t r i n d e x r i n d e x use of undefined value a = F o o s u b s t r a, 5 s u b s t r u n d e f A a. oats peas beans b. deans barley c. peas beans barley 2) printf ( % f a ) a b c ) t r / a - z / A - Z t r / A - Z / a - z a. b.
110 ) c s h i f t c a t s p u s h b a r l e y p o A 2) c a ) b t r / a - z / A - Z / r o s e b u d R O S E B U D t r / A - Z / a - z / r o s e b u d H a n g m a n s u b s t r 9-2
111 1 0 M a c i n t o s h P e r l P e r l u n i x P e r l P e r l P e r P e r l 10.1 o p e n d i r d i r h a n d l e d i r e c t o r y o p e n d i r 2 P e r l U N I X U N I X Wi n d o w s
112 114 r e a d d i r r e a d d i r u n d e f r e a d d i r r e a d d i U N I X r e a d d i r... r e a d d i r c l o s e d i F I L E S... / ^ \.\.? $ / g r e p r e a d d i r o p e n d i r / t m p o p e n ( F I L E H $ f i l e ) / t m p m y f i l e. t x t r e a d d i r m y f i l e. t x t m y f i l e. t x t / t m p / m y f i l e. t x t Globbing g l o b b i n g D O S d i r *. t x t. t x t U N I X g l o b b i n g s h e l l l s *. t x t. t x P e r l g l o b G l o b giob p a t t e r n p a t t e r n p a t t e r n p a t t e r n 10-1 g l o b g l o b
113 g l o b 10-1 globbing f d f u d f i d f d d f * d f d f d d f o o d f i l l e d [ c h a r s ] c h a r s ; f [ o u ] d f o d f u d f a d M a c P e r l { a b } a f *{ t x t d o c } f. t x t. d o c b M a c P e r l U N I X P e r l g l o b C s h e l l g l o b b i n g B o u r n e K o r n s h e l l g l o b b i n g P e r l U N I X s h e l l Bourne shell g l o b b i n g Korn shell globbing C shell globbing *? g l o b b i n g g l o b opendir/readdir/closedir g l o b g l o g l o b s h e l l o p e n d i r / r e a d d i r / c l o s e d i r g l o b o p e n d i r / r e a d d i r / c l o s e d i r g l o b / u s r / i n c l u d e / *. h / u s r / i n c l u d e r e a d d i r g l o b o p e n d i r / r e a d d i r / c l o s e d i r P e r l g l o b b i n g o p e n d i r / r e a d d i r / c l o s e d i r
114 116 P e r l g l o b < > g l o b g l o b b i n g g l o b 10.2 UNIX grep U N I X g r e p U N I X g r e p P e r l g r e p 10-1 m y g r e p 1 U N I X g r e p g r e p perl mygrep 10-1 mygrep 1 - w 3 use strict m y 5 ~ 8 $ d i r $ p a t S T D I N
115 $ f i l e use strict $ f i l e 1 2 $ d i r $ f i l e d $ d i r / $ f i l e $ f i l $ d i r $ d i r / $ f i l e 1 5 ~ 18 $ d i r / $ f i l e 1 9 ~ 23 $ p a t 10-2 m y g r e p 10-2 mygrep 10.3 r e a d d i r P e r l U N I X p w d s h e l l D O S Wi n d o w s C :\ W I N D O W S D O c d D O S / P e r l P e r l P e r l c w d o p e n F Hf i l e d i e c h d i r chdir newdir; c h d i r n e w d i n e w d i r n e w d i c h d i r c h d i r P e r l
116 118 P e r l c h d i r c h d i U N I X Windows 95 Wi n d o w s N T D O S c h d i r H O M E H O M c h d i r P e r l use Cw d c w d use Cwd c w use Cwd P e r l Cw d P e r l C w d Ca n t locate I N C C w d. p m P e r l m k d i r m k d i r n e w d i r m k d i r m k d i r P e r l U N I X p e r m i s s i o n s p e r m i s s i o n s 0755 U N I X D O S Wi n d o w s 0755 r m d i r r m d i r p a t h n a m e r m d i r P a t h n a m e r m d i r r m d i r r m d i r
117 u n l i n k u n l i n k l i s t _ o f _ f i l e s l i s t _ o f _ f i l e s _ u n l i n k $ e r a s e d u n l i n k $ e r a s e f i l e s u n l i n k u n l i n k P e r l r e n a m e r e n a m e o l d n a m e n e w n a m e o l d n a m e n e w n a m e r e n a m e r e n a m e n e w n a m e r e n a m e
118 UNIX P e r l U N I X U N I P e r l U N I X U N I X P e r l U N I X P e r l U N I X u n l i n k U N I X U N I X P e r l u n l i n k P e r l I / O P e r l U N I X P e r l U N I X U N I X U N I U N I X U N I X UNIX 24 1 P e r l chmod 755 scriptname 755 s c r i p t n a m e U N I X c h m o d P e r l U N I X c h m o d c h m o d l i s t _ o f _ f i l e s m o d e 0
119 c h m o d m k d i r m k d i r c h m o d U N I X c h m o d c h a n g e m o d e 10.5 P e r l s t a t s t a t U N I X U N I U N I X S t a t s t a t s t a t s t a t 10-3 stat U N I X Wi n d o w s 0 d e v C 2 D 1 i n o 0 2 m o d e 3 3 n l i n k 0 Windows NT 4 u i d I D U I D 0 5 g i d ID G I D 0 6 r d e v 7 s i z e 8 a t i m e 9 m t i m e 1 0 c t i m e I n o d e 11 b l k s z 0 12 b l o c k s U N I X s t a t
120 122 s t a t s t u ff m o d e s t a t & p r i n t f 0 ~ 7 U N I X 8 U N I X P e r l p r i n t f l o c a l t i m e Sat Jul 3 23:35:11 EDT 1999 U N I X Microsoft Wi n d o w s c t i m e s t a t 1 s t a t 10.6 C h a p t e r _ 01. r t f C h a p t e r _ 02. r t f C h a p t e r _ 04. r t f H o u r _ 01. r t f H o u r _ 02. r t f H o u r _ 04. r t f 10-3 R e n a m e r 1
121 Renamer 1 3 ~ 15 $ d i f i l e s 1 7 ~ f i l e s _ o l d n a m e _ ~ 2 5 $ / d i r / $ o l d n a m f i l e s Rename 10.7 P e r l m k d i r r m r e n a m e s t a t
122 D I R H A N D L DIRHANDLE g l o b ( *.* ) *.* g l o b (*.*) g l o b D O S *.* m y g r e p o p e n d i r 15 F i l ef i n d *. b a t *. t m p 10-3 *. b a t *. b a * \*\. b a t * 19 s /\ Q $ o l d p a t / $ n e w p a t / ) f o o f i l e a. print glob( f o o f i l e ) b. print (stat( f o o f i l e ) ) [ 9 ] ; c. print scalar localtime (stat ( f o o f i l e ) ) [ 9 ] 2) unlink a. b. c ) b c b 1970
123 c 2) a c u n l i n k
124 11 P e r l P e r l P e r l P e r l system() Wi n d o w s D O S U N I X 11.1 system() P e r l s y s t e m () s y s t e m () P e r l P e r l s y s t e m c o m m a n d 0 Tr u e F a l s e P e r l U N I X s y s t e m D O S Wi n d o w s s y s t e m
125 s y s t e m D O S d i r U N I X l s p e r l d o c U N I X D O S s y s t e m P e r l P e r l s y s t e m S T D I N S T D O U T P e r l s y s t e m U N I X Wi n d o w s D O S m y f i l e. t x t U N I X v i D O S e d i t P e r l s y s t e m U N I X D O S Wi n d o w s s y s t e m P e r l s y s t e m s h e l l U N I X / b i n / s h D O S Wi n d o w s c o m m a n d. e x e s y s t e m s h e l l U N I X & p e r l d o c p e r l f a q 5 f a q f i l e. t x t D O S U N I X U N I X
126 128 x t e r m & U N I X s h e l l s y s t e m P e r l P e r l x t e r m U N I X P e r l b i n / s h s y s t e m s h e l l U N I X s y s t e m M a c i n t o s h M a c P e r l M a c i n t o s h 11.2 s y s t e m P e r l s y s t e m o u t f i l d a t a d i r P e r l ` ` P e r l s y s t e m d i r $ d i r e c t o r y s h e l l > U N I X & d i r f o r e a c h P e r l q x {} {}
127 {} < > [] shell P e r l U N I X D O S Wi n d o w s $ H O M E P e r l $ H O M E s h e l l $ H O M E D O S % w i n d i r % c o m m a n d. c o m w i n d i r P e r l % w i n d i r % $ H O M E P e r l $ H O M E P e r $ H O M E % w i n d i r P e r l $ H O M E UNIX shell H O M E % w i n d d i r % c o m m a n d. c o m w i n d d i r q x {} q x P e r l qx P e r l 11.3 U N I X D O S Wi n d o w s U N I X d i r l s D O S
128 130 d i r o u t f i l e s o r t o u t f i l e s o r t n e w f i l e m o r e n e w f i l e o u t f i l e n e w f i l e d i r s o r t s o r t s o r t m o r e 1 > U N I X D O S Wi n d o w s P e r l P e r To t a l e r P e r l U N I X dir /B ls To t a l e r 11-1 To t a l e r 6 S T D I N $ _ S T D I N S T D O U T S T D I N dir B 9 ~ 13 $ d i r s 1 4 ~ 15 $ s i z e s 1 7 ~ 1 8 P e r l P e r l o p e n o p e n dir/b sort P e r l
129 o p e n P e r l dir /B sort R H A N D L E s o r t P e r l o p e n m o r e P e r l W H A N D L E m o r e 1 R H A N D L E W H A N D L E o p e n c l o s e P e r l c l o s e c l o s e o p e n U N I X P e r l c l o s e 11.4 P e r l P e r V M S U N I X M a c i n t o s h M S D O S P e r l P e r l P e r l P e r l 16 P e r l Wi n d o w s D O S U N I X Wi n d o w s U N I X Wi n d o w s U N I X MacOS 9 Windows NT U N I X P e r l Windows NT P e r l U N I X We b
130 132 use strict P e r l open die o p e n P e r l s y s t e m ` ` I O I O 8 use strict 3 m y s c r i p t. p l F o o f i l e. t x t 24 4 P e r l $ d i r = ` d i r ` Wi n d o w s < * > o p e n d i r / r e a d d i r / c l o s e d i r P e r l P e r Amazon.com web P C Windows NT Sun 1000 UNIX C G I We b Windows NT U N I X P e r l
131 $ ^ O ^ O Wi n d o w s D O S M S Wi n 32 U N I X U N I X l i n u x a i x s o l a r i s e m a i l Wi n d o w d i r bytes free $ f r e e Wi n d o w s U N I X L i n u x Wi n d o w s d i r U N I X df -k. df -k 4 $ f r e e d f U N I X P e r l
132 134 D O S Wi n d o w s L i n u x f r e e s p a c e () U N I X O S 11.5 s y s t e m ` ` P e r l o p e n p r i n t < > open (P cmd )
133 c m d < P > c m d print P... P e r l C a n t do bidirectional pipe I P CO p e n 2 14 $ a = s y s t e mc m d $ a c m d s y s t e m ` ` s y s t e m c m d $ a = ` c m d ` U N I X ` ` U N I X P e r l S T D O U T S T D E R R S T D O U T S T D E R R o p e n S T D O U T s h e l l S T D O U T S T D E R R P e r l FA Q perldoc perlfaq8 FA Q ) 1 2) $foo $r=`dir $foo` a. $foo s h e l l b. Perl $ f o o d i r 3) a. b. c ) a b a m y p r o g. p l m o r e b M m o r e 2 ) b $ f o o P e r l qx`dix $foo` 3) a b g l o b < * > o p e n d i r r e a d d i r C r m d i r
134 U N I X U N I X f r e e s p a c e () L i n u x
135 1 2 P e r l P e r l P e r l P e r l P e r l P e r l P e r l P e r l P e r l P e r l 12.1 P e r l P e r l P e r P e r l D O S Wi n d o w s M S - D O S C :\ U N I X P e r l M a c i n t o s h S c r i p t D e b u g g e r D e b u g g e r E m p l o y e e D O S P e r l - d P e r l
136 help ( ) 7 7 E m p l o y e e 5 11 D B < 1 > 1 P e r l h e l p h h h cmd h P e r l P e r l n n P e r l E m p l o y e e 5 11 m y ( $ L 1 $ F 1 ) = s p l i t $ e m p l o y e e s 5 P e r e m p l o y e e s
137 Perl n 23 P e r l s o r t s o r t n s o r t E n t e r P e r l l 10 l 10 l l i n e n o l i n e n o l start-end = = = > 33 s o r t P e r l P e r l b breakpoint b r e a k p o i n t
138 c c P e r l P e r l 33 p r i n t - e m p c p r i n t _ e m p () 33 L print_emp ( ) E m p l o y e e 33 d d line d s u b n a m e p r i n t - e m p () R
139 Perl R P e r l P e r l 33 n p r i n t - e m p () p r i n t - e m p () n s n s 1 p r i n t _ e m p () 1 b print_emp p r i n t _ e m p () n P e r l $ h o u r l y P r i n t f $ h o u r l y q
140 P e r l use strict P e r l 12-1 Buggy 12.3 P e r l P e r l M a c i n t o s h S c r i p t l - l i n e r s One-Liners P e r l - e - e P e r l - e
141 Perl Wi n d o w s / D O S c o m m a n d. c o m N T S h e l l p r i n t Hello Wo r l d > < ^ D O S / Wi n d o w s U N I X \ UNIX shell(csh k s h b a s h ) s h e l l s h e l - e - d P e r l P e r l 1 P e r l P e r l - c P e r l P e r l - w - c P e r l P e r l P e r l P e r Perl 5 - v
142 144 P e r l _ 02 - v P e r I N C P e r l P e r l P e r l < > 1) < S T D I N > 2) g l o b < *. b a t > P e r l E x a m p l e. p l < > f i l e 1 1 f i l e 2 f i l e 3 S T D I N U N I X S e d a w k P e r l P e r - w - c - d - A R G V $ A R G V [ 0 ] f i l e 1 $ A R G V [ 1 ] f o l e 2 P e r l - n - e
143 Perl P e r l f i l e 1 w h i l e $ _ 1 S / ^ \ S + // g - p - n P e r l d o s f i l e P e r l d o s f i l e > d o s f i l e P e r l o n e - l i n e r s Perl Journal P e r l 12.4 P e r l < > P e r l P e r l - n - p P e r l P e r l Wi n d o w s P e r l A c t i v e s t a t e m a i n
144 146 P e r l P e r l perldoc perlrun ) ) < > a. undef b. c. Tr u e 3) Prel P r e l a. T b. t ) f o r $ _ = 20 $ _ > - 1 $ _ $ m e s s = s / g l a s s e s / g l a s s / $ m e s s $ _ = = ~ 2) b < > S T D I N 3) b t T
145 1 3 P e r l p a s c a l C B A S I C J a v a P e r l P e r l P e r P e r l 13.1 $ a S t o n e s $ a $ b $ a $ a = $ b $ a $ b
146 148 $ r e f $ a $ r e f $ r e f $ a $ a $ a = F o o (print $a) $ r e f $ a $ r e f $ r e f S C A L A R ( 0 x 0000 ) $ r e f $ a $ r e f $ r e f $ a $ $ r e f $ P e r l $ r e f $ r e f $ a $ r e f $ $ r e f $ r e f $ r e f $ $ o r e f $ $ n r e f G a n d a l f
147 $ b r e f 2 $ $ b r e f $ b r e f $ $ b r e $ $ $ b r e f $ a r e a r r $ a r e a r r $ $ a r e f [ 0 a r $ a r e f [ 2 3 $ a r e a r a r r $ $ a r e f [ 0 ] $ { $ a r e f } [ 0 ] $ $ a r e f [ 2 3 ] $ { $ a r e f } [ 2 3 $ a r e { $ a r e f } $ a r e a r r % h a s h $ h r e f % h r e f % h a s h $ $ h r e f { k e y } % h a s h $ { $ h r e f }{ k e y } % $ h r e f %{ $ h r e f }
148 g e t a r r a y s (@ f r u i v e g g i e s g e t a r r a y s f r u i t v e g e t a b l e g e t a r r a y s g e t a r r a y s () $ f r u i t _ r e f $ v e g _ r e f
149 13 % h a s h c h a n g e h a s h % l o c a l _ h a s h % l o c a l _ h a s h % l o c a l _ h a s h % h a s % h a s c h a n g e h a s h () $ h r e f % h a s h $ h r e f c h a n g e h a s h () % h a s h b e P e r l % h a s h $ h r e f % h a s h % h a s $ h r e f % h a s h $ h r e f P e r l % h a s h $ a h r e f {}
150 152 [] use strict P e r l $ r e f use strict P e r l - w undefined value P e r l
151 P e r l P e r l i s t _ o f _ l i s t s $ # $ l i s t _ o f _ l i s t s [ 1 l i s t _ o f _ l i s t s A R R AY 0 x l i s t _ o f _ l i s t P e r l P e r l Perl Data Structures Cookbook(Perl ) Perl Data Structures Cookbook
152 154 Perl Data Structures Cookbook perldoc perldsc P e r l P e r l $ m y s t e r y _ r e f e r e n c e S C A L A R H A S H C O D E $ m y s t e r y _ r e f e r e n c e P e r l $ r e f $ r e f x f r u i t v e g e t a b l e $ a A R R AY 0 x b d 4 3 A R R AY 0 x A R R AY 0 x 2011 f b b 4 A R R AY
153 x 2011 f a a 0 3 D a t ad u m p e r D a t ad u m p e P e r l D a t ad u m p e r M a z e Maze 13-2 Maze
154 156 1 ~ 2 P e r l - w use strict 4 ~ m a z e n s e w 1 0 ~ 11 % d i r e c t i o n x - 1 y x 1 33 ~ ~ 15 m y use strict $ c u r r _ x $ c u r r _ y 0 0 $ x $ y x y 2 0 $ m a z e [ $ c x ][ $ c y ] n s e w 1 % f u l l n s e w ( n )
155 ( N o r f h ) 2 5 $ n e w 2 8 l c s u b s t r $ n e w E a s t e We s t w s 2 9 $ m a z e [ $ $ x r e f ][ $ $ y r e f ] n s e w 3 3 ~ 34 x y e $ d i r e c t i o n { e } 0 1x 0 $ d i r e c t i o n { e }[ 0 ] Y 1 $ d i r e c t i o n { e }[ 1 ] 3 7 x y $ c u r r _ x $ c u r r _ y $ x $ y $ m o v e c h o m p q 4 2 m o v e _ t o () m o v e _ t o () $ c u r r _ x $ c u r r _ m a z e P e r l $ x $ y 13.4 P e r l p r i n L O L A R R AY 0 x A R R AY 0 x p r i n a r r a y P r i n L O L O L O $ r e f = \( $ a $ b $ c ) P e r l \ $ a $ b $ c \ $ a \ $ b \ $ c $ c
156 158 $ r e f = [ $ a $ b $ c ] ) $ r e f = \ p e a n u t s $ r e f a. b. peanuts c. 2) a. b. c. 1) c $ r e f = \ 100 a 2) b k i d s M a z e 4 n e n w s e s m a z e % d i r e c t i o n [ 1 1 ][- 1-1 ]
157 1 4 P e r l P e r l P e r l s y s t e m world wide w e b 10 w e b P e r l Perl 5 P e r l P e r l w e b Windows OLE P e r l P e r l P e r l C G I P e r l P e r l P e r l 14.1 P e r l P e r l u s e C w d use Cwd; use Cwd 10 10
158 160 use Cwd 1) Perl use Cwd 2) P e r l C w d P e r l 3) Perl 4) Perl P e r l use strict use Cwd u s e P e r l u s e s t r i c t s t r i c t use Cwd use Cwd c w d c w d P e r l p e r l d o c C w d 1
159 C w d 3 c w d g e t c w d f a s t g e t c w d C w d P e r l C w d C w d. p m P e r I N C C w d. p m perl -v P e r l T K L M P P e r l P e r l perl -v P e r l P e r l Perl 5 13 Perl 4 3 Use Cwd use cwd F i l ef i n d P e r l 150 P e r l
160 162 P e r I N C P e r l 14.2 P e r l i m p o r t a n t. d o c d o c u m e n t s o p e n d i r / r e a d d i r / c l o s e d i r d o c u m e n t s d o c u m e n t s d o c u m e n t s a c c o u n t i n g m i s c p e r s o n a l 30 P e r l F i l e F i n d F i l ef i n d f i n d f i n d f i n d & d i r l i s t 14-1 i m p o r t a n t. d o c 14-1
161 P e r l - w use strict 3 F i l e Fi n d f i n 5 / d o c u m e n t s w a n t e d () $ F i l ef i n dn a m e $ _ i m p o r t a m t. d o c 1 0 \& w a n t e d f i n d / d o c u m e n t s w a n t e d () f i n d $FileF i n dname $FileF i n ddir $_ $ _ 14-2 F i l ef i n d C D. t m p U N I X t m p. t m p
162 164 u n l i n k P e r l 1) 2) 3) 4) P e r l F i l ec o p y s o u r c e f i l e d e s t i n a t i o n c o p y 1 0 $ F i l ec o p y m o v e m o v e i m p o r t o n t. d o c d :/ a r c h i v e s / d o c u m e n t s m o v e m o v u n l i n k Perl P e r l N e tp i n g N e tp i n g U N I X p i n g p i n g p i n g p i n g N e tp i n g N e tp i n g p i n g e c h o
163 w w w. y a h o o. c o m p i n g e c h o P e r l Windows 95/98 N T N e tp i n g N e tp i n g a l a r m Wi n d o w s A c t i v e s t a t e Wi n d o w s P e r l Wi n d o w s P e r l English E n g l i s h P e r l while(< >) S T D I N $ _ use English $ _ $ A R G E n g l i s h diagnostics P e r l d i a g n o s t i c s P e r l P e r l d i a g n o s t i c s P e r l
164 166 P e r l h e l p \@ s u p p o r t. c o m use s u p p o r t m s u p p o r t P e r l W D S ( F ) F P e r l P e r l 60 P e r l use diagnostics p e r l d i a g 14.3 P e r l P e r p e r l d o c A u t o L o a d e r A u t o S p l i t B e n c h m a r k C G I C PA N C a r p D i r H a n d l e E n v E x p o r t e r E x t U t i l s* F i l e* F i l es p e c* F i l e C a c h e F i n d B i n G e t o p t* P e r l P e r l We b Common Gateway Interface ( 17 ~ 24 ) P e r l F i l ec o p y
165 ( ) I 18 NC o l l a t e I P C* M a t h* N e t* P o d* S y m b o l S y sh o s t n a m e S y ss y s l o g Te r m* Te x ta b b r e v Te x tp a r s e Wo r d s Te x ts o u n d e x Ti e* Ti m e* c o n s t a n t i n t e g e r L o c a l e N e th o s t e n t I P w w w. Ya h o o. c o m P e r l Plain Old Documentation P e r l I P U N I X S o u n d e x P e r l Sat Jul 24 16:21:38 EDT P e r l We b h t t p / / w w w. c p a n. o rg C Wi n d o w s A c t i v e s t a t e P e r l P P M U N I X Wi n d o w s C PA N U N I X A c t i v e s t a t e P P M 14.4 P e r l P e r l P e r l F i l ef i n d $ F i l ef i n d d i r P e r l
166 168 C w d $ C w dx $ m a i nx $ x Windows 95/98/NT A c t i v e s t a t e P P M C PA N U N I X Wi n d o w s C r e q u i r e u s e P e r l r e q u i r e r e q u i r e u s e Perl 4 u s e r e q u i r e r e q u i r e u s e r e q u i r e r e q u i r e u s e ) c w d use Cwd; a. b. cwd c. c w d 2) $ _ a. LongVa r s b. English c. $_ ) a u s e 2) b use English $ _ $ A R G C PA N B u n d l elw P 2 4
167 1 5 P e r l D B M 15.1 DBM D B M D B M P e r l D B M 7 D B M P e r l d b m o p e n d b m o p e n h a s h D B M f i l e n a m e f i l e n a m e. p a g f i l e n a m e. d i r P e r l m o d e P e r l D B M U N I X D B M 0666 D B M mode 0644 Wi n d o w s 0666 D B M d b m o p e n % h a s h d b m f i l e D B M P e r l d b m f i l e. p a g d b m f i l e. d i r P e r l D B M
168 170 P e r l D B M D B M d b m c l o s e D B M f e l i n e c a n i n e D B M D B M P e r l D B M D B M k e y s v a l u e s d e l e t e D B M % h a s h = () d b m o p e n D B M D B M D B M 1024 D B M d b m o p e n d b m o p e n % h d r o m e d a r e dbmclose D B M D B M D B DBM D B M P e r l P e r l
169 D B M r e c o r d s D B M keys %recs foreach my $key % r e c s keys %recs P e r l e a c h e a c h e a c h e a c h e a c h e a c h D B M e a c h m e m o p a d 15-1 m e m o p a d m e m o p a d X is Y X Y like pattern p a t t e r n q u i t 15-1 m e m o p a d
170 172 m e m o p a d D B M 15-2 memopad 1 ~ 2 P e r l - w use strict 6 d b m o p e n % a n s w e r s D B M a n s w e r s a n s w e r s. p a g a n s w e r s. d i r 7 w h i l e ( 1 ) l a s t e x i t 9 l c < S T D I N > S T D I N
171 $ _ c h o m p 1 0 q u i t w h i l e 11 $ _ l i k e $ $ p a t t e r n % a n s w e r s $ p a t t e r n i f $ $ 1 $ s u b j e c t $ s u b j e c t % a n s w e r s I don t know i f X is Y X $ s u b j e c t $ i n f o 2 8 $ i n f o $ s u b j e c t % a n s w e r s 3 4 D B M % a n s w e r s 15.3 We b D B M O r a c l e S y b a s e
172 174 [ s p a c e ] [ n e w l i n e ] P e r l Susan B o b M a u r y D B M p h o n e. t x t P e r l
173 r e a d d a t a () p h o n e. t x D ATA Wr i t e d a t a () r e a d d a t a () p u s h u n s h i f t s p l i c e w r i t e d a t a P H O N E L I S T S p l i c e p o p s h i f t, g r e p r e a d d a t a P H O N E L I S T g r e P H O N E L I S T A n P H O N E L I S P H O N E L I S T w r i t e d a t a () U N I X + >
174 o p e n o p e n F< f i l e o p e n (F: file ) o p e n ( F> f i l e ) o p e n ( F> > f i l e ) o p e n ( F+ < f i l e ) o p e n ( F+ > f i l e ) o p e n ( F+ > > f i l e ) s e e k s e e k t e l l t e l l ( F ) 24 This is at the beginning s e e k t e l l o p e n s e e k t e l l o p e n p e r l f u n c perldoc perlfunc p e r l f u n c p e r l o p e n t u t o p e n perldoc perlopentut 15.5 P e r l U N I X
175 Windows NT Windows 95 Windows 98 We b P e r l 2 D a v i d P H O N E L J o y P H O N E L D a v i d 1 2 J o P H O N E L D a v i d P H O N E L D a v i d 2 1 J o y D a v i d w r i t e d a t a ()
176 UNIX NT U N I X Windows NT P e r l f l o c k f l o c k f l o c k f l o c k f l o c k f l o c k f l o c k use Fcnt1 qw( f l o c k ) l o c k _ t y p e l o c k _ t y p e lock_sh f l o c k Lock_EX f l o c k Lock_UN f l o c k
177 o p e n F H, > f i l e n a m e f l o c k > g e t _ l o c k () r e l e a s e _ l o c k () r e a d d a t a () w r i t e d a t a () g e t _ l o c k () r e l e a s e _ l o c k ()
178 g e t _ l o c k () r e l e a s e _ l o c k ( ) r e a d d a t a ( ) writedata () g e t _ l o c k () r e a d d a t a P H O N E L w r i t e d a t a () r e l e a s e _ l o c k ( ) Windows 95 Windows 98 Windows 95 Windows 98 Windows 95 Windows 98 f l o c k
179 g e t _ l o c k () r e l e a s e _ l o c k () Windows 95 Windows 98 f l o c k f l o c k f l o c k U N I X N F S f l o c k U N I X Windows NT U N I X f l o c k f l o c k P e r l FA Q f l o c k perlfaq P e r l D B M D B M D B M D B M D a t ad u m p e r D B M D B M 15-3 g e t _ l o c k () r e l e a s e _ l o c k () D B M o p e n c l o s e f l o c k f l o c k f l o c f l o c k L o c k _ N B
180 ) D B M a. b. 2) a. b. c. 3) FA Q ) b D B M ) a c 3) FA Q
181 1 6P e r l P e r l P e r l P e r l P e r l P e r l P e r l C PA N 16.1 Perl P e r l P e r l Perl 1988 I n t e r n e t I n t e r n e t 6 1 Wold Wide We b 1991 C E R N World Wi d e We b 1993 M o s a i c I n t e r n e t U s e n e t I n t e r n e t Larry Wa l l U N I X a w k s e d P e r lp e r l P e r l C s e d a w k s h P e r l c s h P a s c a l B A S I C P L U S P e r l C
182 184 s e d a w k s h s e d a w k s h C P e r l s e d a w k P e r l P e r l P e r l Perl 2 P e r l P e r l P e r l 1991 Larry Wa l l Randal Schwartz Programming Perl P e r P e r l Perl 4 Perl 4 P e r l 1992 I n t e r n e t Perl Programming Perl P e r l P e r l P e r L i n u x F r e e B S D Apache We b N e t s c a p e M o z i l l a Eric S Raymond (The Cathedral and the B a z a a r ) U R L Larry Wa l l P e r l P e r l P e r l Larry Wa l l G N U
183 16Perl 185 P e r l P e r l P e r l P e r l P e r P e r l P e r l P e r l P e r l P e r l P e r l P e r l P e r l P e r l A r t i s t i c ( ) h t t p :// w w w. g n u. o rg G N U P e r l P e r l Perl P e r l Perl P e r l P e r Larry Wa l l P e r l P e r l ( m a j o r. m i n o r _ p a t c h l e v e l P e r l P e r l 1999 P e r l P e r l 5. 6 Perl Perl CPAN P e r l C PA N
184 CPAN P e r l C PA N P e r l P e r l C PA N C PA CPAN T K N e t* M a t h* D a t e* Ti m e D a t e* Tr e e* D B I* D B D* Te r m* S t r i n g* Te x t* C G I* U R I* H T M L* LW P* G D G r a p h i c s* I m a g e* Wi n 3 2* Wi n 3 2 A P I* 16-1 CPA N P e r l Win32 API G t k G n o m e Q t X I I M a i l Te l n e t I R C L D A P * B - O r a c l e i n f o r m i x I n g r e s O D B C M s q I M y s q l S y b a s e D O S C o m m a n d U N I X We b Microsoft Wi n d o w s C PA N C PA N R E A D M E P e r l P e r G N U C PA N P e r l C PA N
185 16Perl 187 C PA N P e r l P e r l C PA N C PA 16.3 P e r l 5 6 P e r l 2300 P e r l P e r l P e r l P e r l P e r l P e r l
186 188 P e r l P e r l P e r l 1) - w 2) use strict - w use strict p r i n t p r i n t p r i n t D E B U G S T D E R R _ L I N E _ _ F I L E _ P e r l P e r l P e r 12 P e r l P e r l
187 16Perl P e r l Perl P e r l perldoc perl P e r l P e r l P e r l p e r l d o c P e r l h t t p / / w w w. p e r l. c o m U s e n e t 80 I n t e r n e t U s e n e t P e r l c o m p. l a n g. p e r l. a n n o u n c e c o m p. l a n g. p e r l. m o d e r a t e d comp.lang perl.misc P e r l P e r l P e r l U s e n e t We b d e j a. c o m S u p e r n e w s. c o m We b U s e n e t We b P e r l P e r l d e j a. c o m U s e n e t We b P e r l d e j a. c o m P o w e r S e a r c h 100 U s e n e t
188 190 d e j a. c o m U s e n e t U s e n e t We b 1) P e r l P e r l d e j a. c o m 2) P e r l comp.lamg. perl.misc C G I c o m p. i n f o s y s t e m s. w w w. a u t h o r i n g. c g i 3) 4) a. b. c. a. b. EXE u u e n c o d e d c. MIME
189 16Perl 191 5) 6) C G I, We b U s e n e t U s e n e t 16.4 P e r l P e r l P e r l Larry Wa l l Tom Christiansen Randal Schwartz Programming Perl P e r l P e r l Tom Christiansen Nothn To r k i n g t o n The Perl Cookbook P e r l P e r l P e r l P e r l P e r l P e r l I n t e r n e t H o b b e Internet Ti m e l i n e P e r l C PA S T P e r l C PA N
190 192 h t t p / / w w w. Perl.com Eric S. Raymond 16.5 P e r l P e r C PA N P e r l We b P e r l P e r C G I P e r l C G I P e r l C G I P e r l C G I U s e n e t C PA N h t t p :// s e a r c h. c p a n. c o m We b CPAN ) P e r l C G I U s e n e t a. c o m p. i n f o s y s t e m s. w w w. a u t h o r i n g. c g i b. c o m p. l a n g. p e r l. m i s c 2) a. b. c o m p. l a n g. p e r l. m i s c c, h t t p :// w w w. Perl.com ) a c o m p. l a n g. P e r l. m i s c C G I 2) a c a c w w w. P e r l. c o m
191 Perl C G I 1 7CGI HTTP C G I 2 1c o o k i e 2 2 C G I We b
192 1 7C G I I n t e r n e t Wold Wide We b 1993 We b I n t e r n e t 1993 I n t e r n e t I n t r a n e t 1993 We b We We b We b We b We b We b We b C G I 7 H T M L H T M L H T M L We b H T M L We b HTML is <I>not</I> hard to learn < I > < / I > We b n o t H T M L H T M L World Wide We b W 3 C h t t p :// w w w. w3c.org HTML 24 H T M L We b C G I C G I 17.1 Web We b We b We N e t s c a p e Internet Explorer O p e r a We b We We b We b We b We We b We b We 17-1
193 196 Perl C G I 17-1 We b We b Web Web Web Web We b U R L U R L U R L http H T T P We b f t p H T T P h t t p s w w w.google.com IP : 80 h t t p 80 more.html / a r c h i v e s / f o o. h t m l & h t t p ) w w w. g o o g l e. c o m I P 2) I P w w w. g o o g l e. c o m 3) We b m o r e. h t m l 4) m o r e. h t m l 5) We b 17-2 We b Web Web Web
194 17CGI Web CGI We b We b Web Web Web We b C G I C G I We b We b U R L C G I C G We b We C G I We b Web Web CGI C G I We b 1) C G I 2) CGI We b 3) We b 4) CGI C G I P e r l C UNIX shell p a s c a l L I S P T C L C G I P e r l P e r l C G I C G I H T M We b C G I H T M L C G I P e r l H T M L H T T P We b C G I h t t p :// w w w. n c s a.uiuc.edu/cgi/ interface.html 7 C G I
195 198 Perl C G I 17.2 C G I C G C G I We b C G I We b C G I We b We b We b We b We b P e r l C G I Perl 5 C G I We b Perl 5 C G I C G I Perl 5 We b Perl CGI C G I We b We b Wi n d o w s We b P e r l C G I We b Wi n d o w s M i c r o s o f t Internet Information Server(IIS) U N I X We b U N I X We b I n t e r n e t We b A p a c h e C Apache We b A p a c h e Miorosoft Wi n d o w s A p a c h e h t t p : / / w w w. a p a c h e. o rg We b C G I We b We b We b We b C G I We b C G I C G I We b We b
196 17CGI 199 We b We b FA Q We b C G I We b FA Q C G I We b P e r l P e r l We b We b M i c r o s o f t We b We b C G I C G I We b We C G I C G I. c g i. p l C G I We b C G I c g i - b i n We b C G I URL We b U R L C G I h t t p :// w w w. m y s e r v e r. c o m / c g i / 17.3 CGI C G I C G I 17-1 h e l l o C G I C G I C G I. c g i h e l l o. c g. p l h e l l o. p 17-1 C G I 1 We b P e r l - w 2 C G I q w s t a n d a r d C G I
197 200 Perl C G I 3 use strict C G I 5 C G I h e a d e r C G I 6 C G I Hello world C G I CGI C G I F T P C G I 1. UNIX We b t e l n e t r l o g i n UNIX We b C G I 1) F T P C G I h e l l o. c g i h e l l o. p l U N I X v i 2) m v c p C G I C G 3) U N I X h e l l o. p l C G I 2. F T P UNIX We b F T P C G I 1) F T P h e l l o. c g i h e l l o. p l C G I C G I A S C I C G I F T P 2) C G I C G h e l l o. p l h e l l o. p C G I 3) F T P C u t e - F T P Set Permissions Change Mode Set File Attributes Set File Access M o d e ( ) 755
198 17CGI NT We b NT We b N T E x p l o r e r C G I C G I 4. F T P NT We b F T P NT We b F T P h e l l o. c g i hello.pl C G I C G I A S C I I C G F T P CGI C G I C G I U R L C G I U R L U R C G I h e l l o. c g i C G I 1) H e l l o w o r l d We b 2) We b C G I C G I C G I C G C G I We b C G I C G I 17.4 CGI C G I C G I C G I C G I h e l l o. c g i CGI C G I C G I We b C G I P e r l C G I C G I
199 202 Perl C G I P e r l C G I C G I 18 U N I X C t r l D C t r l D Wi n d o w s C t r l + Z P e r l C o n t e n t - Ty p e t e x t / h t m l H T M L 20 h e a d e r C o n t e n t - Ty p e C G I P e r l P e r l Ca n t locate I N C C G I. p m...) P e r l P e r l C G I Not Found 404 Nat Found(404 ) U R L h t t p :// w w w. s e r v e r. c o m c g i - b i n / h e l l o. c g i h t t p :// w w w. s e r v e r. c o m / c g i / h e l l o. c g i C G I U R L We b C G I We b C G I. p l. c g i C G I U R L C G I U R L We b We b C G I C G I We b We b F o r b i d d e n 403 Error(403 )
200 17CGI 203 C G I UNIX We b h e l l o. c g i ls -1 hello.cgi F T P d i r r w x r- x r- x C G I Internal Server Error 500 Error 5 00 C G I Internal Server Error We b We b C G I U N I X tail server_log We b C G I F T P P C I n t e r n a l Server Error No such file or directory exec of /cgi-bin/hello.cgi failed / c g i - b i n / h e l l o. c g i P e r l We b P e r l F T P l s d i r P e r l F T P C G I A S C I Wi n d o w s U N I X C G I U N I X F o r b i d d e n C a n t locate CGI.pm C G I. p m )
201 204 Perl C G I P e r l P e r C G I C G I P e r l P e r l Syntax error w a r n i n g Global symbol requires e t c ( ) P e r l C G I Premature end of script headers C G I h e a d e r C o n t e n t - Ty p e h e a d e r h e a d e h e a d e r Perl CGI C o n t e n t - Ty p e t e x t / h t m l \ n \ n h e a d e r h e a d e r \ n \ n s y s t e m h e a d e r ( ` ` ) h e a d e r Perl CGI 17.5 C G I We b We C G I C G I C G I
202 17CGI 205 C G I C G I I n t e r n e t 16 C G I 100 Perl CGI C G I C G I c g i - l i b. p l c g i - l i b. p l C G I c g i - l i b. p l P e r l C G I C T C L P e r l C G I Perl P e r l C G I P e r l C G I Perl P e r l C G I c o m p. l a n g. p e r l. m i s c c o m p. i n f o s y s t e m s. w w w. a u t h o r i n g. c g i h t t p :// w w w. w 3. o rg / C G I / FA Q ) CGI a. P e r l UNIX Shell C b. C c. 2) We b P e r l a. b ) c P e r l C G I C G 2 ) b P e r l 1987 We b 1991 C E R N
203 206 Perl C G I H e l l o w o r l d l o c a l t i m e H T M L P e r l H T M L We b We
204 18 We b H T M L H T M L We b We b We b S u b m i t C G I C G I Perl CGI C G I C G I 18.1 We b We b H T M L HTML H T M L H T M L H T M L H T M L C G I H T M L < H E A D > < B O D Y > < D O C T Y P E > H T M L H T M L H T M L H T M L H T M We b We b C G I 18-1 H T M L 18-1 H T M L
205 208 Perl C G I N e t s c a p e N e t s c a p e 18-1 < F O R M > H T M L m e t h o d G E T P O S T G E C G I G E T P O S T a c t i o n C G I U R L < I N P U T > n a m e < T E X TA R E A > n a m e d e s c r i p t i o n H T M L n a m e C G I n a m e n a m e s u b m i t C G I HTML 4.0 T E X TA R E A r o w s c o l s H T M L h t t p :// w w w. w 3 c. o rg HTML submit We b We b 18-2 b o d y s e x
206 We b 18-2 a c t i o n U R L C G I U R L Web CGI C G I G E T P O S T C G I Web CGI C G I 18-5 H T M L H T M L U R L H T M L C G I 18-5 We b C G I Web CGI 18.2 CGI C G I C G I p a r a m p a r a m C G I C G 18-1 p a r a m b o d y s e x n a m e s u b m i t p a r a m p a r a m ( s e x ) m a l e f e m a l e 18-2 C G I 18-2 C G I
207 210 Perl C G I p a r a m p a r a u n d e f GET POST 18-1 < F O R M > m e t h o d M e t h o d We b We b G E T < F O R M > G E T U R L C G I We b U R L C G I U R L p a r a m p a r a m P O S T U R L We b H T M L C G I C G I p a r a m I n t e r n e t C G I Q U E RY _ S T R I N G R E Q U E S T M E T H O D G E T P O S T C G I G E T We b We b U R L U R L C G I s a m p l e. p l C G I G E T U R L C G I C G I G E T C G I U R L P O S T U R L We b U R L P O S T C G I We b
208 Web C G I World Wide We b C G I We b We b H T M L We b C G I We b C G I We b We b We b We H T M L 18-6 I n t e r n e t 18-6 Internet Web C G I We b Internet Web I n t e r n e t We b We b C G I I n t e r n e t I n t e r n e t We b We b h t t p h t t p s
209 212 Perl C G I C G I We b P e r l I n t e r n e t I n t r a n e t We b C G I 18-3 H T M L 18-4 C G I 18-3 We b 18-4 d i r e c t o r y. c g i C G I 18-3 d i r e c t o r y. c g i C G I 18-3 d i r e c t o r y. c g i D O S / w i n d o w s ls -1 d i r We b C G I $ d i r e c t o r y We b d i r n a m e / h o m e cat e t c / p a s s w d C G I We b UNIX shell M S - D O S We b I n t e r n e t P e r l - T t a i n t e d ( ) o p e n o p e n s y s t e m P e r l PAT H directory. c g i
210 P e r l P e r P e r l s e c H T M L C G I 18-6 H T M L 18-6 c o l o r 15 H T M L l e n g t h 15 H T M L J a v a J a v a S c r i p t c o l o r 15 P e r l We b We We b We b H T M L C G I C G I C P U C G I
211 214 Perl C G I 18.4 We b H T M L We b 18-7 H T M L 18-7 / c g i - b i n / h e l p d e s k. c g i C G I 18-8 C G I C G I U R L C G I
212 P e r l g e t _ l o c k () r e l e a s e _ l o c k () C G I C G I h e l p d e s k. c g i C G I H T M L C G I C G p a r a m C G I C G C G I C G I
213 216 Perl C G I C G I I n t e r n e t $ E N V { Q U E RY _ S T R I N G } C G I C G I P e r l - T Too late for -T option - T - T P e r l P e r l P e r l - T Perl -T -d foo.cgi P e r l C G I C G I P e r l ) p a r a m a. undef b. c. 2) C G I P O S T G E T a. b. 3) HTML p a s s w o r d a. b ) c p a r a m 2) a 3) a H T T P C G I d i s p l a y () d i s p l a y
214 1 9 We b 19.1 C G I We b We b We b We We b We We b We b We b / We b H T M L 19.2 We b We H T M L H T M H T M L H T M L f u l l n a m e Pink Floyd Perl CGI p a r a m
215 218 Perl C G I We b We b H T M L Go to Store C G I C G I H T M L C G I H T M L C G I 19-3 H T M L H T M L We b H T M L
216 We b H T T P C G I 19-3 We b View Page Source 19.3 We b We We b 4 We b We 4 We We b C G I use CGI::Carp qw (fatalstobrowser), C G I d i e () We b We b C G I
217 220 Perl C G I C G I ~ 8 H T M L s a v e r e p e a t _ h i d d e n 1 2 ~ 13 C G I p a g e _ o n e 1 4 ~ 17 p a g e o n e H T M L C G I p a g e _ t w o p a g e t w o p a g e _ t h r e e 1 9 H T M L C G I p a g e o n e p a g e t w o s u r v e y _ d o n e We b s u b m i t 19-4 s u b m i t C G I We b
218 CGI pageone CGI 3. pagetwo CGI CGI 5. pagethree 2 2 ~ 24 P e r l here document h e r e d o c u m e n t here document < < here document E N D _ O F _ Q U O T E 19-2 E N D _ PA G E _ O N E here document here document here document here document H T M L P e r l p r i n t 19-2 H T M L < F O R M >
219 222 Perl C G I < F O R M > a c t i o n C G I C G I m e t h o d G E T p a g e o n e p a g e o n C G I C G We b 19-3 C G I s u r v e y _ a n s w e r s H T M L n a m e = 4 8 ~ s u r v e y _ a n s w e r s H T M L <INPUT TYPE=hidden> ~ 6 0 p a r a mp e t t y p e d o g c a t $ p e t p a r a mp e t t y p e g o l d f i s h
220 ~ 76 H T M L p a g e _ t h r e e r e p e a t _ h i d d e n 19-5 C G I 19-5
221 224 Perl C G I s a v e 1 03 s a v e 18 s a v e g e t _ l o c k r e p e a t _ h i d d e n r e l e a s e _ l o c k 19.4 We b We b H T M L P e r l C G I H T M L H T M L < H E A D > < H T M L > D T D H T M L We b We b Ca n t find string terminator x x x x anywhere before EOF at... here document here here document M A R K
222 M S - D O S Wi n d o w s here document ) We b a. c o o k i e b. H T M L c. H T M L c o o k i e 2) H T M L < F O R M > a c t i o n a. b. s u b m i t We b C G I c. s u b m i t 3) a. print<<eop 19-2 b. HTML < H E A D > c ) b c H T M L c o o k i e 2 b a c t i o n < F O R M > U R L U R 3) b p r i n t < < E O P here document c C G I / - C G I / 4 0 % 4 5 % 1 5 % 2 0 % 1 5 % 30 % 3 5 % 3 5 % 4 0 %
223 2 0 H T T P C G I We b C G I We b H T M L C G I H T M L C G I 20.1 HTTP 17 We b N e t s c a p e Internet Explorer We b A p a c h e I I S C G I H T T P HTTP 1.0 HTTP 1.1 I n t e r n e t I n t e r n e t Request For C o m m e n t ( ) R F C R F C I n t e r n e t h t t p :// w w w. i e t f. o rg We b H T T P R F C R F C We b We b G E T U R L HTTP 1.0 c o n n e c t i o n We b We b k e e p - A l i v e
224 20 HTTP CGI 227 A c c e p t A c c e p */* i s o A c c e p t - E n c o d i n g g z i p GNU Zip Ac c e p t - L a n g u a g e H o s t We b U R L We b M o z i l l a / [ e n ] C - c 32 f 404 p Wi n N T; U We b We b G E T We b 200 S e r v e r N e t s c a p e - Enterprise/3.51 G We b C o n t e n t - L e n g t h 2222 We b 50 % 60 % C o n t e n t - Ty p e We b H T M L t e x t / h t m l i m a g e / j p e g L a s t - M o d i f i e d We b We We b We We b We Web We b We b We b Te l n e t Te l n e t U N I X H T T P U N I X Te l n e t Microsoft Wi n d o w s Te l n e t S t a r R u n Te l n e t M a c i n t o s h Te l n e t We b Te l n e t w w w. w e b s e r v e r. c o m We b 80 8 We b ) Te l n e t
225 228 Perl C G I Te l n e t H T T P U N I X Wi n d o w s M a c i n t o s h E n t e r We b H T T P We b C G I H T M L C G I C G I h e a d e r M I M E C o n t e n t - Ty p e C o n t e n t - Ty p e h e a d e r t e x t / h t m l H T M L h e a d e r t e x t / h t m l - t y p e M I M E t e x t / p l a i n i m a g e / g i f i m a g e. j p e g G I F J P E G a p p l i c a t i o n / a p p n a m e a p p n a m e M I M E a p p l i c a t i o n / o c t e t - s t e a m We b We b We b H T M L Perl CGI We b H T M L H T M L < I M G > C G I. g i f. j p g
226 20 HTTP CGI 229. j p g G I F C G I d a i l y _ i m a g e. c g i C G I H T M L $ i m a g e d i r $ e r r o r. j p g 1 0 ~ 16 Wi n d o w s S T D O U T. j p g S T D O U T b i n m o d e S T D O U T I M A G E U N I X b i n m o d e H T T P C o n t e n t -Ty p e i m a g e / j p e g t e x t / h t m l 2 5 $ e r r o r d i s p l a y - i m a g e 2 6 r e a d d i r. j p j p e g s
227 230 Perl C G I 20.2 CGI C G I C G I U R L U R L t i m e. c g i C G I t i m e. c g i We b 17 H e l l o Wo r l d C G I H T M L S u b a m i t C G I p r o c e s s. c g i C G I C G H T M L CGI P e r l C G I f o o. c g i X t h i s Y t h a t <A HREF> U R L U R L U R L CGI C G I H T M L C G I s i g n A r i e s y e a r 1969 C G I C G p a r a m
228 20 HTTP CGI 231 a u t h o r C G I U R L U R L & I n t e r n e t RFC 2396 U R L A S C I I H e l l o, Wo r l d! U R L C G I U R L U R L H T M L CGI use CGI qw :all escape C G I e s c a p e U R L
229 232 Perl C G I C G I p a r a m U R L & C G I 20.3 We b We b We b We b S S I H T M L We b HTML We b We b 20-2 We b H T M L C G I 20-2 H T M L We b Web Web Web w/ssi S S I S S I H T M L H T M. s h t m l. s t m S S I Web We b H T M L H T M L Apache We b <!--#echo var= L A S T _ M O C I F I E D - - > A p a c h e We b We b
230 20 HTTP CGI 233 ( ) We b We b S S I We b S S I M i c r o s o f t Personal We b S S I SSI HTML Apache We b M i c r o s o f t Internet Information We b We b S S I We b S S I # e x e c SSI #exec H T M L We b # e x e c s t o c k p r i c e. c g i C G I C G I H T M L C G I # e x e c H T M L SSI We b H e l l o, Wo r l d d a y. j p g n i g h t. j p g day. jpg night. jpg H T M L H T M L. s h t m l. s t m S S I
231 234 Perl C G I s u n m o o n. c g i CGI C G I q w : a l l 6 l o c a l t i m e 4 l o c a l t i m e [ 2 ] $ h o u r # C G I h e a d e r We b 1 6 < I M G > $ d a y $ n i g h t A LT 8 We b We b 20.4 C G I r e d i r e c t h e a d e r C G I e s c a p e p a r a m C G I 20-1 perldoc CGI C G I
232 20 HTTP CGI 235 We b We H T T P We b r e f e r e r u s e _ a g e n t We b s e r v e r _ n a m e 20-1 r e f e r e r u s e r _ a g e n t r e m o t e _ h o s t s c r i p t _ n a m e s e r v e r _ n a m e v i r t u a l _ h o s t We b U R L I n t e r n e t We b N e t s c a p e I E Ly n x We b I P We b U R L / c g i - b i n / f o o. c g i C G I C G I s e r v e r _ n a m e We b Vi r t u a l _ h o s t We b We b 20.5 C G I H T T P C G I We b We b We Microsoft Wi n d o w s N e t s c a p e We b
233 236 Perl C G I U R L C G I We b We b We b a. Web Web X Web Y c. Web b. CGI C G I r e d i r e c t r e d i r e c t H T T P We b 20-3 Wi n d o w s N e t s c a p e We b We b $ b r o w s e r 1 0 U R L $ t a rg e t N e t s c a p e 1 3 ~ 14 $ b r o w s e r M o z i l l a Wi n 1 6 C G I J a v a S c r i p t H T M L J a v a S c r i p t J a v a S c r i p t w i n d o w. l o c a t i o n. h r e f H T M L < M E TA HTTP- E Q U I V = r e f r e s h > We b J a v a S c r i p t H T T P H T M L
234 20 HTTP CGI 237 C G I u s e r _ a g e n t N e t s c a p e M o z i l l a We b M o s a i c Windows 95 Netscape 4.51 u s e r _ a g e n t M o z i l l a / Wi n 95 I 20.6 We b H T T P C G I S S HTTP S S I S S I We b S S We b S S I We b S S I H T M L S S I HTML SSI <!--#exec cgi--> S S I C G We b view source S S I We b S S I Te l n e t Te l n e t We b Te l n e t 80 Te l n e t Te l n e t G E T E n t e r ) U R L <A HREF=" /cgi/foo.pl? name=ben Franklin&Job=printer"> a. b. C G I c. Ben Franklin
235 238 Perl C G I 2) a. b. We b c ) c 2) b We b SSI HTML Te l n e t We b We
236 2 1c o o k i e 19 H T M L We b We C G I H T T P c o o k i e HTTP Cookie H T T P C G I Co o k i e H T M L c o o k i e c o o k i e c o o k i e 21.1 cookie c o o k i e HTTP cookie C G I C G I HTML We b c o o k i e c o o k i e We b C G I c o o k i e c o o k i e 21-1 c o o k i e 21-1 c o o k i e C G I Web CGI C G I c o o k i e c o o k i e Web CGI
237 240 Perl C G I cookie c o o k i e c o o k i e c o o k i c o o k i e c o o k i e CGI cookie cookie c o o k i e C G I c o o k i e c o o k i e c o o k i e c o o k i P e r l c o o k i e c o o k i c o o k i e c o o k i e C G I h e a d e r c o o k i e - v a l u e - n a m e c o o k i e - e x p i r e s - p a t h - d o m a i n - s e c u r e C G I h e a d e r c o o k i e c o o k i e c o o k i e h e a d e r c o o k i e C G I c o o k i e C G I s a m p l e c o o k i e c o o k i e This cookie contains no MSG c o o k i e c o o k i e c o o k i e c o o k i e C G I c o o k i e c o o k i e c o o k i e c o o k i
238 21 cookie 241 c o o k i e C G I c o o k i e c o o k i e Sample cookie C G I c o o k i e c o o k i c o o k i e cookie sample c o o k i e c o o k i c o o k i e c o o k i N e t s c a p e A d v a n c e d P r e f e r e n c e s c o o k i e Internet Explorer Internet Options A d v a n c e d c o o k i e cookie We b We b 1) 2) c o o k i e 3) We b 4) C G I ColorChanger
239 242 Perl C G I 7 ~ 10 C G I p a r a mc o l o r $ r e q u e s t e d _ c o l o r 1 2 ~ 14 b g c o l o r c o o k i e $ o l d _ c o l o r c o o k i e 1 5 ~ 19 c o o k i e c o o k i e 2 0 ~ 24 c o o k i e c o o k i e 2 5 ~ 42 H T M L 30 H T M L cookie 21-2 c o o k i e c o o k i e C G I We b c o o k i e c o o k i e We b
240 21 cookie Cookie 1 0 c o o k i e c o o k i e $ c o o k i e 1 c o o k i e 11 ~ 12 c o o k i e c o o k i e c o o k i e c o o k i c o o k i e c o o k i e 21.2 cookie c o o k i e c o o k i e c o o k i e c o o k i e c o o k i e c o o k i e c o o k i e U R L cookie c o o k i e c o o k i c o o k i e H T M L c o o k i e c o o k i c o o k i e c o o k i e P e r l C G I c o o k i e c o o k i e c o o k i - e x p i r e s - e x p i r e s c o o k i e cookie + 30 s m h M Y 1 n o w c o o k i e - 10 m c o o k i e S a t u r d a y,28-aug :51:05 GMT
241 244 Perl C G I c o o k i e cookie c o o k i e c o o k i c o o k i e c o o k i e c o o k i e c o o k i c o o k i c o o k i e c o o k i e c o o k i e c o o k i c o o k i e c o o k i e c o o k i e c o o k i e c o o k i e c o o k i e N e t s c a p e c o o k i e c o o k i e s. t x t Internet Explorer c o o k i e \ Wi n d o w s \ C o o k i e s HTTP cookie c o o k i e We b cookie c o o k i e c o o k i e c o o k i We b C o n g o. c o m We b We b w w w. c o n g o. c o m s h o p p i n g. c o n g o. c o m 21-3 We b w w w. c o n g o. c o m
242 21 cookie We b Web HTML Web www: congo.com shopping congo.con w w w. c o n g o. c o m H T M L C G I w w w. c o n g o. c o m c o o k i e w w w. c o n g o. c o m We b c o o k i e Cookie www: congo.com www: congo.com shopping congo.con w w w. c o n g o. c o m s h o p p i n g. c o n g o. c o m c o o k i e s h o p p i n g. c o n g o. c o m HTTP cookie c o o k i w w w. c o n g o. c o m c o o k i e shopping.congo. com s h o p p i n g. c o n g o. c o m c o o k i e c o o k i c o o k i e w w w. c o n g o. c o m c o o k i e congo.com We b We b c o o k i e Cookie www. congo.com Web Web Web www. congo.com shopping congo.com www. foo. com c o o k i e - d o m a i n c o o k i e
243 246 Perl C G I cookie c o o k i e c o n g o. c o m We b c o n g o. c o m c o o k i e. c o m. n e t c o o k i e. c o m. c o m cookie c o o k i e c o o k i c o o k i e We b U R L CGI URL 21-6 We b 21-6 We b s a l e s C G I e n g i n e e r i n g C G I sales CGI c o o k i e engineering CGI C G I c o o k i e c o o k i e - p a t h c o o k i e U R L sales CGI c o o k i e c o o k i e - p a t h = > C G I - p a t h C G I U R L C G I s c r i p t _ n a m e C G I U R L c o o k i e c o o k i
244 21 cookie cookie c o o k i e c o o k i - s e c u r c o o k i e c o o k i c o o k i e c o o k i e c o o k i e c o o k i e c o o k i We b c o o k i e c o o k i e 21.3 cookie c o o k i e c o o k i e Web CGI cookie c o o k i e c o o k i cookie c o o k i e C o o k i e c o o k i e - e x p i r e c o o k i e c o o k i e cookie HTTP cookie H T T P We b I n t e r n e t c o o k i e c o o k i e c o o k i N e t s c a p e 1. 1 Internet Explorer Ly n x, O p e r a We b c o o k i e c o o k i C G I u s e r _ a g e n t c o o k i e cookie c o o k i e
245 248 Perl C G I We b We b We b I n t e r n e t c o o k i e c o o k i c o o k i e c o o k i e c o n g o. c o m We b We b We b We b c o n g o. c o m We b c o o k i e We b We b We We b We We c o o k i e c o o k i e We b c o o k i e c o o k i e We b c o o k i e c o o k i e c o o k i e c o o k i e We b We b c o o k i e HTTP cookie 21.4 HTTP cookie C G I c o o k i e We b c o o k i e c o o k i e c o o k i e HTTP cookie
246 21 cookie 249 c o o k i e c o o k i e S p l i t c o o k i e We b 1) A HREF C G I U R L 2) r e d i r e c t. p l C G I p a r a m t a rg e t U R L h t t p :// w w w. congo.com 3) U R L c o o k i e 4) c o o k i e We b t r a c k e r c o o k i e U R L c o o k i e We b C G I r e d i r e c t h e a d e r - c o o k i e ) c o o k i e a. c o o k i e b. c o o k i e
247 250 Perl C G I c. c o o k i e 2) c o o k i e c o o k i - e x p i r e a. +7d b. +1w c m 3) c o o k i e a. cookie b. c o o k i e c. cookie ) 3 2) a c + 1 w 3) We b I M G
248 21 cookie 251
249 2 2 C G I We b P e r l We b We b I n t e r n e t U N I X U N I X We b 22.1 Internet P e r l I n t e r n e t P e r l N C S A We b U N I X U N I X UNIX-to-UNIX copy, UUCP UUCP UUCP UUCP Mail U U C P P C Simple Mail Transport Protocol, SMTP 22-2 Post Office Portocol, POP I n t e r n e t Internet Message Access Protocol, IMAP S M T
250 252 Perl C G I 22-2 SMTP SMTP SMTP SMTP POP IMAP SMTP S M T P Mail Transport Agent, MTA M TA U N I X M TA s e n d m a i l s e m d m a i l U N I X f o b a r. c o m s e n d m a i l Microsoft Wi n d o w s M a c i n t o s h M TA P e r l N e t :: S M T P M TA S M T P S M T P S M T P I n t e r n e t I S P S M T P We b s e n d _ m a i l P e r l
251 CGI P e r l I n t e r n e t I S P I S P I S P a o l. c o m h o t m a i l. c o m I S P F r o m ( Reply To ) P e r l I S P I S P I S I S I n t e r n e t 22.2 P e r l C G I M TA s e n d m a i l S M T P
252 254 Perl C G I UNIX U N I X s e n d m a i l U N I X s e n d m a i l 22-1 U N I X U N I X 22-1 send_mail 6 sendmail s e n d m a i l 8 $ s e n d m a i l s e n d m a i l M A I L 9 ~ 14 M A I L 1 5 ~ 17 M A I L \ n 4 s e n d m a i l U N I X U N I X $ s e n d m a i l s e n d m a i l / u s r / l i b / u s r / s b i n,/ l i b
253 CGI m a i l p i n e s e n d m a i l 21-1 s e n d m a i l -t ( F r o m To S u b j e c t ) -oi. ( ) -odq - o d q s e n d _ m a i l ( ) UNIX s e n d m a i l M TA Wi n d o w s M TA P e r l P e r l N e t :: S M T P P e r l P e r l We b N e ts M T P l i b n e t L i b n e t P e r l U N I X Wi n d o w s M a c i n t o s h P e r l 22-2 M TA s e n d _ m a i l 22-2 M TA s e n d _ m a i l
254 256 Perl C G I 5 N e t :: S M T P 1 0 N e t :: S M T P ~ 2 3 N e t : : S M T P 4 $ s m t p = N e t :: S M T P - > n e w $ r e l a y $ s m t p $ s m t p - > m a i l ( $ f r o m ) - > m a i l $ s m t p N e t :: S M T P N e t :: S M T P $smtp->mail(addr) mail $smtp->to(addr) to t B C C $smtp->data() d a t a $smtp->datasend(data) To : F r o m D a t e : R e c e i v e d : $ s m t p - > d a t a s e n d ( \ n ) $ s m t p - > d a t a s e n d () $smtp->dataend() dataend
255 CGI $smtp->quit() S M T P 22.3 Web s e n d _ m a i l () We b We b C G I 22-3 H T M L 22-3 H T M L C G I C G
256 258 Perl C G I s e n d _ m a i l To : We b m a s t e m y h o s t. c o m We b To 1 3 C G I e l s e C G I I n t e r n e t I n t e r n e t R F C R F C R F C -
257 CGI / ^ [\ w. -] + \@([\ w, - ]\.) + \ w + $ / m s o m e w h e r e. c o m R F C I n t e r n e t 22.4 We b s e n d _ m a i l () P e r l I n t e r n e t We b C G I r e m o t e _ h o s t We b r e m o t e _ u s e r N e t s c a p e Internet Explorer We a t ) p o s t m a s t e r r o o C G I From nobody s e n d m a i l I D We b We b I D n o b o b y We b h t t p d r o o t F r o m :
258 260 Perl C G I C PA N M I M E ) $foo=net::smtp->new( m a i l h o s t ) U N I X a. b. $ f o o S M T P c. N e t :: S M T P 2) a. f o o! b a r! b a z! q u u x b a r. c o m c. s t u ff % j u n k! Wo w z e r s! f o o. c o m! b l a t ) b a Perl 4 c use Net::SMTP 2) C G I We b 19
259 2 3 C G I We b We b 23.1 We b We C G I We b C G I 90 C G I I m still working, 20%complete ( 10 ) I m still working,20% complete( 20 ) We b We b We b We M i c r o s o f t I n t e r n et Explorer We b Internet Explorer We b
260 262 Perl C G I We b C G I (nonparsed header)cgi C G C G I We b C G I C G 500 C G I Web Web C G I We b Apache We b C G I n p h - p u s h. c g i C G I n p h - p u s h. c g i C G I We b M i c r o s o f t I n t e r n e t Internet Information Se r v e r, IIS C G I C G I h e a d e r I I S C G I We b Web We b We b 5 We b We b We b S t o p C G I We b 23-1 H T M L We b C G I 23-1 HTML
261 C G I : p u s h C G I - n p h C G I 8 m u l t i p a r t _ i n i t We b m u l t i p a r t _ i n i t We b h e a d e r 9 w h i l e ( 1 ) w h i l e 1 0 m u l t i p a r t _ s t a r t We b We We b 11 4 l o c a l t i m e Sun Sep 5 15:15: m u l t i p a r t _ e n d We b m u l t i p a r t _ s t a r t w h i l e m u l t i p a r t _ i n i t m u l t i p a r t _ e n d We b We b / i m a g e s We b 23-2
262 264 Perl C G I m u l t i p a r t _ s t a r t (- t y p e = > i m a g e / j p e g ) C G I We b H T M L J P G J P E G IMG SRC H T M L We b H T M L We b U R L We b H E A D H T M L 6 We b h t t p :// f o o. b a r. c o m C G I We b We We C G I h e a d e r - R e f r e s h We b U R L c o o k i e We b We b P e r l We b Internet Explorer 23.2 We b We b 23 3 We b We b We We b We b
263 We b 0 1 I D We b We We b We We b We b We b A l t a Vi s t a G o o g l e H o t B o t We b We b We b R e f r e s h We b We b 17 We b We b A Web A A
264 266 Perl C G I We b I S P a o l. c o m h o m e. c o m I S P I S P We b We b We b I n t e r n e t We b We b We 23-5 We b I n t e r n e t 23-5 We b Web A A We b r e m o t e _ h o s t We b We b We b 20 C G I h i t s. c g i S S I We b
265 ~ 23 $ c o u n t e r f i l e 2 8 ~ 30 $ c o u n t e r f i l e We b We We b Perl CGI C PA N G D P e r l G D I M G H T M L Perl CGI d i g i t _ 0. j p g d i g i t _ 1. j p g d i g i t _ 9. j p g 20 C G I g r a p h i c a l _ h i t s. c g i We b
266 268 Perl C G I $ i m a g e _ u r l U R L U R L 3 4 ~ 35 $ h i t s $ d i g i t I M G 23.3 We b
267 We b We b C G I C G I We b 20 H T M L P O S T We b P O S T ) C G I a. m u l t i p a r t _ s t a r t m u l t i p a r t _ e n d b. m u l t i p a r t _ i n i t, m u l t i p a r t _ s t a r t m u l t i p a r t _ e n d c. p u s h _ s t a r t p u s h _ e n d 2) H T M L a. b. 3) We b a. P O S T H T M L b. c. C G I ) b m u l t i p a r t _ i n i t We b m u l t i p a r t _ s t a r m u l t i p a r t _ e n d We b 2) b M E TA H T M L h e a d e r - R e f r e s h We b
268 270 Perl C G I 3) a
269 2 4 We b We b C G I We b We We b I n t e r n e t We b 24.1 We b We b We b We b Web Web Original Material We b C G I We b We b Web
270 272 Perl C G I We b We b We b I S P We b We b We b We b We We b S l a s h d o t. o rg We b We b S l a s h d o t. o rg h t t p :// w w w. s l a s h d o t. o rg We b FA Q We b S l a s h d o t 1) HTML We b headlines.cgi CGI 2) C G I S l a s h d o t. o rg We b 3) C G I We b We b P e r l LW P :: S i m p l e LW P I n t e r n e t We b F T P LW PS i m p l e l i b w w w - p e r l We b H T M L U R L We b L i b w w w - p e r l LW PS i m p l e We b $ c o n t e n t U R L We b Sl a s h d o t 24-1 Slashdot
271 Web 24-2 Slashdot 24-3 Slashdot 3 ~ 6 F c n t l LW P :: S i m p l e
272 274 Perl C G I g e t S l a s h d o t We b C G I C G I 8 U R L s t o r y X M L P e r l 9 $ c a c h e S l a s h d o t S l a s h d o t g e t _ l o c k () r e l e a s e _ l o c k () 3 $ c a c h e P e r l - M P e r l - M M 0.25 ( ) 1 - M ( ) 2 4 U R L LW PS i m p l e g e t $ d o c g e t u n d e f 2 5 g e t _ l o c k () r e l e a s e _ l o c k () i f C G I 33 ~ s t a t $ c a c h e S l a s h d o t. c g i
273 Web l o c a l t i m e S l a s h d o t t i t l e < u r l > U R L $ 1 $ t i t l e $ l i n k < u r l > < t i t l e > < u r l > $ t i t l e $ l i n k 45 H T M L S l a s h d o t X M L X M S l a s h d o t FA Q 24-2 H T M L 24.2 We b. t x t. t x t C G I. t x t C G I
274 276 Perl C G I C G I f o o. t x t f o o. a n s w e r t x t $ s u r v e y _ d i r. t x t We b 755 U N I X Wi n d o w s f i n d _ l a s t _ f i l e (). t x t. a n s w e r $ s u r v e y _ d i r g e t _ f i l e _ c o n t e n t s ()
275 Web f i n d _ l a s t _ f i l e () u n d e f g e t _ f i l e _ c o n t e n t s (). t x t. a n s w e r f i n d _ l a s t _ f i l e () g e t _ f i l e _ c o n t e n t s (). t x t $ q u e s t i o a n s w e r s 40 / c g i / w r i t e s u r v e y. c g i C G a n s w e r s 0 a n s w e r s a n s w e r C G I 40 / c g i / w r i t e s u r v e y. c g i S u b m i t g e t _ l o c k () r e l e a s e _ l o c k () g e t _ f i l e _ c o n t e n t s () f i n d _ l a s t _ f i l e () C G I
276 278 Perl C G I 24-6 g e t _ f i l e _ c o n t e n t s () f i n d _ l a s t _ f i l e () g e t _ l o c k () r e l a s e _ l o c k () $ s u r v e y _ d i r We b
277 Web 46 $ q u e s t i o p o s s _ a n s w e r s 50 S u b m i t 53 g e t _ l o c k ( ) 56. t x t f i r s t. t x t. t x t. a n s w e r f i r s t. a n s w e r r e l a s e _ l o c k () 6 6 g e t _ f i l e _ c o n t e n t s () % r e s u l t s % r e s u l t s C G I H T M L / w e b / h t d o c s / p o l l Windows NT G u e s t U N I X c h m o d 777 We b. a n s w e r
278 280 Perl C G I We b We b We b We b We b. t x t. a n s w e r c h m o d. a n s w e r M i c r o s o f t Ti c k e t m a s t e r M i c r o s o f t Ti c k e t m a s t e r We b Ti c k e t m a s t e r M i c r o s o f t S l a s h d o t X M L H T M H T M L H T M L
279 Web H T M L C PA N H T M L C PA N H T M H T M L* ) We b H T M L a. LW P b. c. lynx -dump netscape -print 2) LW P :: S i m p l e g e t a. No Documcnt b. c. u n d e f ) a b c 2) c g i f. g i f. g i f
280
281 P e r l P e r P e r l P e r l m o d i n s t a l l O S 2 V M S A.1 h t t p :// w w w. p e r l. c o m C PA N C PA N C PA N I m a g es i z e We b LW P P e r l l i b w w w - p e r l C PA N l i b n e t LW P l i b n e t A.2 C PA N D a t em a n i p D a t em a n i p A.2.1 Windows95 98 NT Wi n d o w s ActiveState Tool P e r l ActiveState To o l Wi n d o w s Perl Package Manager (PPM) P P M D O S A - 1 I n t e r n e t P P M P P M ActiveState Perl p p m. b a t
282 286 s e a r c h A c t i v e S t a t e C PA N A-1 D O S D a t e - M a n i p i n s t a l l D a t em a n i p P C I n t e r n e t A c t i v e S t a t e We b h t t p ::// w w w. A c t i v e S t a t e. c o m A c t i v e S t a t e P e r L FA Q P P M Wi n d o w s P e r l Wi n d o w s P e r l
283 287 A.2.2 UNIX CPAN U I N X ANSI C P e r l G N U g z i p g u n z i p U N I X h t t p :// w w w. f s f. o rg U N I X H P C ANSI C C C GNU P e r l P e r l C PA N CPAN s h e l l P e r l $ perl -MCPAN -e shell C PA N P e r l C PA N I n t e r n e t C PA N i p a t p a D a t em a n i p C PA N C PA N C PA N C PA N
284 288 A.2.3 UNIX C PA N U N I X CPAN C PA N D a t e :: C a l c D a t e - C a l c - X. Y. t a r. g z D a t e - C a l c c d, m a k e m a k e
285 289 make test make test A.2.4 Macintosh M a c i n t o s h M a c P e r l FA Q MacPerl FA Q h t t p :// W W W. m a c p e r l. c o m A.3,, P e r l Wi n d o w s P P M P P s e t C :\ m y p e r l
286 290 U N I X CPAN m a k e p l _ a rg m a k e P R E F I X / h o m e / c l i n t p / p e r l / l i b P e r l P e r l use lib D a t e :: M a n i p h o m e / c l i n t p / p e r l / l i b A - 2 A-2 D a t e :: M a n i p P e r l
ebook65-5
5 P e r l P e r l I / O P e r l P e r l P e r l P e r l P e r l I / O P e r l P e r l 5.1 P e r l P e r ( ) S T D I N P e r l S T D I N 2 $ @ P e r l f o r e a c h e l s e i f P e r l p e r l f u n c o
ebook15-C
C 1 1.1 l s ( 1 ) - i i 4. 14 - d $ l s -ldi /etc/. /etc/.. - i i 3077 drwxr-sr-x 7 bin 2048 Aug 5 20:12 /etc/./ 2 drwxr-xr-x 13 root 512 Aug 5 20:11 /etc/../ $ls -ldi /. /..... i 2 2 drwxr-xr-x 13 root
epub 61-2
2 Web Dreamweaver UltraDev Dreamweaver 3 We b We b We Dreamweaver UltraDev We b Dreamweaver UltraDev We b We b 2.1 Web We b We b D r e a m w e a v e r J a v a S c r i p t We b We b 2.1.1 Web We b C C +
ebook8-30
3 0 C C C C C C++ C + + C++ GNU C/C++ GNU egcs UNIX shell s h e l l g a w k P e r l U N I X I / O UNIX shell awk P e r l U N I X C C C C C C U N I X 30.1 C C U N I X 70 C C U N I X U N I X U N I X C Dennis
epub 75-1
1 Linux L i n u x L i n u x L i n u x L i n u x L i n u x 1.1 Linux 1991 Linus To r v a l d s Intel PC U N I X L i n u x L i n u x L i n u s P C P C L i n u s M i n i x U N I X P C L i n u s I n t e r
Microsoft Word - linux命令及建议.doc
Linux 操 作 系 统 命 令 集 1 基 本 命 令 查 看 系 统 信 息 : uname -a 修 改 密 码 : passwd 退 出 : logout(exit) 获 取 帮 助 : man commands 2 文 件 和 目 录 命 令 显 示 当 前 工 作 目 录 : pwd 改 变 所 在 目 录 : cd cd - 切 换 到 上 一 次 使 用 的 目 录 cd 切 换
epub 63-3
3 Solaris S o l a r i s S o l a r i s 2 S o l a r i s s h e l l p a s s w d v i l s c a t p g m o r e r m 3.1 3.1.1 c p c p c o p y c p c p cp source-file destination-file s o u r c e - f i l e c p d e
ebook65-20
2 0 H T T P C G I We b C G I We b H T M L C G I H T M L C G I 20.1 HTTP 17 We b N e t s c a p e Internet Explorer We b A p a c h e I I S C G I H T T P HTTP 1.0 HTTP 1.1 I n t e r n e t I n t e r n e t
4.进度控制(网络计划)0.ppt
全 国 建 筑 类 执 业 资 格 考 试 共 性 案 例 进 度 控 制 网 络 计 划 1 网 络 计 划 常 用 的 工 程 网 络 计 划 类 型 双 代 号 网 络 计 划 双 代 号 时 标 网 络 计 划 单 代 号 网 络 计 划 A 4 B 单 代 号 搭 接 网 络 计 划 1 D 2 4 C 2 E 5 双 代 号 5 F 2 G 4 2 6 1 工 作 A 4 D 2 4 B
ebook 99-9
9 AWK a w k a w k s h e l l a w k Bailing out a w k : c m d. L i n e : a w k s h e l l a w k a w k a w g r e p s e d s h e l l a w k a w k a w k a w k a w k a w k a w k s e d g r e p a w k a w k A h o.
Microsoft Word - PS2_linux_guide_cn.doc
Linux For $ONY PlayStatioin2 Unofficall General Guide Language: Simplified Chinese First Write By Beter Hans v0.1 Mail: [email protected] Version: 0.1 本 人 是 菜 鸟 + 小 白 欢 迎 指 正 错 误 之 处, 如 果 您 有 其 他 使 用 心 得
ebook43-11
11 Excel 4 E x c e l Access A c c e s s Access Access / Access 2000 / Paradox S Q L A c c e s s SQL Lotus Org a n i z e r A c c e s s A c c e s s Wo r d Word for Windows O D B C ODBC O ffice A c c e s
ebook35-2
2 2.1 Linux login Login: < > Password: < > Linux r o o t l o g o u t 2.2 Linux X Window Linux Linux Bourne ( b s h ) C ( c s h ) Korn ( k s h ) Bourne Steven Bourne UNIX Bourne bash Bourne C Bill Joy Bourne
ebook37-11
11 11.1 ( ) 11.1.1 ( ) 11 157 11.1.2 World Wide Web ( C G I Common Gateway Interface) C G I C G FrontPage C G I I S P F r o n t P a g e C G I F r o n t P a g e F r o n t P a g e FrontPage Web FrontPage
C/C++程序设计 - 字符串与格式化输入/输出
C/C++ / Table of contents 1. 2. 3. 4. 1 i # include # include // density of human body : 1. 04 e3 kg / m ^3 # define DENSITY 1. 04 e3 int main ( void ) { float weight, volume ; int
ebook140-3
3 WAN WAN WNA 2 L A N L A N ( WA N ) ( M A N ) 2 L A N WA N WA I n t e r n e t L A N WA N 3.1 M A N WA WA N WA N WA N M A N WA N G A N (WAN) 3.1.1 WAN WA N L A N L A N 44 WA N 3-1 WA N I P X / S P X I
PowerPoint 演示文稿
Linux 操 作 系 统 基 础 介 绍 课 程 目 标 及 要 求 了 解 Linux 操 作 系 统 的 登 入 方 式 掌 握 常 用 命 令 的 基 本 用 法 能 够 熟 练 在 各 个 目 录 转 换 Outline 1. Linux 操 作 系 统 简 介 2. Linux 操 作 系 统 的 登 录 3. Linux 操 作 系 统 的 目 录 结 构 4. 常 用 命 令 5.
ebook
2 2 P D C S a m b a Windows NT P D C S a m b a ( 2. 0 ) Windows NT P D C ( S a m b a - n t d o m @ S a m b a. o rg ) U N I X P D C U N I X Samba PDC N I S i n t e l S p a r c S a m b a Windows NT PDC 21
IP505SM_manual_cn.doc
IP505SM 1 Introduction 1...4...4...4...5 LAN...5...5...6...6...7 LED...7...7 2...9...9...9 3...11...11...12...12...12...14...18 LAN...19 DHCP...20...21 4 PC...22...22 Windows...22 TCP/IP -...22 TCP/IP
像 客 样 使 命令行 徐 东
像 客 样 使 命令行 徐 东 1 1.1................................ 1 1.2................................. 3 1.3............................. 4 1.3.1 Linux............................ 5 1.3.2 macos............................
ebook140-9
9 VPN VPN Novell BorderManager Windows NT PPTP V P N L A V P N V N P I n t e r n e t V P N 9.1 V P N Windows 98 Windows PPTP VPN Novell BorderManager T M I P s e c Wi n d o w s I n t e r n e t I S P I
ebook
26 JBuilder RMI Java Remote Method Invocation R M I J a v a - - J a v a J a v J a v a J a v a J a v a R M I R M I ( m a r s h a l ) ( u n m a r c h a l ) C a ff e i n e J a v a j a v a 2 i i o p J a v
R F I D R F I D C E P S R F I D 96 R F I D Metalib & SFX M U S E Sm a rt we a ve r
R F I D 96 50 R F I D C E P S R F I D 96 R F I D Metalib & SFX M U S E Sm a rt we a ve r 96 96 143 Metalib & SFX 96 R E A L 6 200 50 60 96 2007 Wi k i 96 1 2 3,524,345 Se a rch Box Ya h o o 96 3 Di re
Persuasive Techniques (motorcycle helmet)
M O D E A T H E E L E M E N T S O F A N A R G U M E N T 1n t h l s t e s t i m o n y g iv e n b e f o r e t h e M a ry l a n d Se n a t e t h e s p e a ke r m a ke s a s t r o n g c l a i m a b o u t t
Learn_Perl 3-02.pdf
2 2. 1 h e l l o h e l l o 23 2 4 2.2 2.2.1 2.2.2 d o u b l e 1 e - 1 0 0 1 e 1 0 0 i n t e g e r 2 5 1.25 2.000 3.0 7.25e45 # 7.25 10 45-6.5e24 # 6.5 10 24 # -12e-24 # 12 10-24 # -1.2E-23 # -- E 2.2.3
AL-M200 Series
NPD4754-00 TC ( ) Windows 7 1. [Start ( )] [Control Panel ()] [Network and Internet ( )] 2. [Network and Sharing Center ( )] 3. [Change adapter settings ( )] 4. 3 Windows XP 1. [Start ( )] [Control Panel
软件测试(TA07)第一学期考试
一 判 断 题 ( 每 题 1 分, 正 确 的, 错 误 的,20 道 ) 1. 软 件 测 试 按 照 测 试 过 程 分 类 为 黑 盒 白 盒 测 试 ( ) 2. 在 设 计 测 试 用 例 时, 应 包 括 合 理 的 输 入 条 件 和 不 合 理 的 输 入 条 件 ( ) 3. 集 成 测 试 计 划 在 需 求 分 析 阶 段 末 提 交 ( ) 4. 单 元 测 试 属 于 动
Progperl.PDF
print "Howdy, world!\n"; 1 2 / / 3 4 / $phrase = " Howdy, world!\n"; print $phrase ; # # / 5 6 / $answer = 42; $pi = 3.14159265; $avocados = 6.02e23; $pet = "Camel"; $sign = "I love my $pet"; $cost = 'It
ebook70-5
5 / 5.1 L i n u x L i n u x X L i n u x 5.1.1 touch t o u c h t o u c h G N U t o u c h # touch newfile # ls -l newfile - r w - r - - r - - 1 bball users 0 Jan 5 12 : 40 n e w f i l e t o u c h 0 # > newfile2
epub 73-5
5 L i n u x I D User ID U I D I D Group ID G I D U I D G I D set -UID Windows NT L i n u x L i n u x U I D Wi n d o w s S I D Windows NT L i n u x N T A d m i n i s t r a t o r L i n u x L i n u x Access
ebook4-12
12 CGI C G I (Common Gateway Interface) We b P H P C G I H T M L H T T P H T M L We b H T T P We We b I n t e r n e t R F C h t t p : / / w w w. i e t f. o rg / P H P C G I C G A p a c h e C G I P H P
ebook37-4
4 4.1 H T M L F r o n t P a g e i m a g e m a p H T M L We b We b 4.1.1 We b We b We b We b 4.1.2 We b 4 35 4.1.3 4-1 G I F 4-2 36 4-1 ( 4-2 ) 4.1.4 We b We b 4-3 4-3 4 37 Ly n x 4-4 4-4 4.1.5 We b We
<4D6963726F736F667420576F7264202D20365F32303131B0E6D2FDD6A4B1A8B8E6B2E5D2B3>
2011 年 版 中 国 引 证 报 告 ( 扩 刊 版 ) 中 国 科 技 术 信 息 研 究 所 北 京 万 方 据 股 份 有 限 公 司 2011 年 版 中 国 引 证 报 告 ( 扩 刊 版 ) 主 任 编 委 贺 德 方 副 主 任 编 委 陈 家 昌 蒋 勇 青 郑 彦 宁 张 玉 华 宋 培 元 主 编 曾 建 勋 副 主 编 潘 云 涛 赵 捷 编 写 人 员 王 立 李 旭 林
, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1
21 , 7, Windows,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) /,,. : ;, 2005. 11 ( 21 ) ISBN 7-81082 - 634-4... - : -. TP316-44 CIP ( 2005) 123583 : : : : 100084 : 010-62776969 : 100044 : 010-51686414
WWW PHP
WWW PHP 2003 1 2 function function_name (parameter 1, parameter 2, parameter n ) statement list function_name sin, Sin, SIN parameter 1, parameter 2, parameter n 0 1 1 PHP HTML 3 function strcat ($left,
封面故事 FENG MIAN GU SHI 32 基于课标 基于学生 提升英语课堂 封面图片 上海市闵行区第四幼儿园 现 代 学 校 37 回归本源 彰显特色 / 胡金芳 出版日期 2015 年 5 月 15 日 35 运用问题情境中的有效提问促进大班 幼儿的语言发展 / 胡金芳 双 月 刊 2015 年第 3 期 总第 63 期 教学实效 / 刘董娴 38 尊重差异 培养能力 提高体育教学实 效
因 味 V 取 性 又 鸟 U 且 最 大 罗 海 惜 梅 理 春 并 贵 K a t h l ee n S c h w e r d t n er M f l e z S e b a s t i a n C A Fe rs e T 民 伊 ' 国 漳 尤 地 视 峰 州 至 周 期 甚 主 第 应
国 ' 东 极 也 直 前 增 东 道 台 商 才 R od e ric h P t ak 略 论 时 期 国 与 东 南 亚 的 窝 贸 易 * 冯 立 军 已 劳 痢 内 容 提 要 国 与 东 南 亚 的 窝 贸 易 始 于 元 代 代 大 规 模 开 展 的 功 效 被 广 为 颂 扬 了 国 国 内 市 场 窝 的 匮 乏 窝 补 虚 损 代 上 流 社 会 群 体 趋 之 若 鹜 食 窝
C/C++ - 文件IO
C/C++ IO Table of contents 1. 2. 3. 4. 1 C ASCII ASCII ASCII 2 10000 00100111 00010000 31H, 30H, 30H, 30H, 30H 1, 0, 0, 0, 0 ASCII 3 4 5 UNIX ANSI C 5 FILE FILE 6 stdio.h typedef struct { int level ;
2004版中文核心期刊要目总览
1 2004 AK 1 2.3 4 5 6 7 8 9 10 11.12.13 14. 15 16 17 18 19 20 21. 22.23 24. 25 26 27 28.29 30 31 32.33. 34.35 36.. 37 38. 39 40. 41. 42 43 44 45 46 47.48 49 50.51. 52 53.54 55. 56 57. 58. 59. 60. 61 62
Windows XP
Windows XP What is Windows XP Windows is an Operating System An Operating System is the program that controls the hardware of your computer, and gives you an interface that allows you and other programs
ebook140-8
8 Microsoft VPN Windows NT 4 V P N Windows 98 Client 7 Vintage Air V P N 7 Wi n d o w s NT V P N 7 VPN ( ) 7 Novell NetWare VPN 8.1 PPTP NT4 VPN Q 154091 M i c r o s o f t Windows NT RAS [ ] Windows NT4
Perl
Perl 磊 Goal Introduction The first perl program Basical coding style Variable Data structure Control structure Regular expression Lab Reference Outline The first perl program Just type this following string
Microsoft Word - 0405
附 件 二 之 4 十 二 年 國 民 基 本 教 育 國 中 教 師 有 效 教 學 深 耕 推 廣 計 畫 優 良 教 案 甄 選 比 賽 教 學 計 畫 ( 教 案 ) 主 題 名 稱 問 路 / 方 向 指 示 教 學 節 數 5 節 教 材 來 源 改 編 教 科 書 ( 康 軒 翰 林 南 一 其 他 主 題 Book4 Unit9: How Do We Get to the Night
ebook 178-3
3 Windows 2000 Server Windows 2000 Windows 2000 Windows 2000 Windows 2000 Windows 2000 Server Windows 2000 Server Windows 2000 Windows 2000 Server 3.1 Windows 2000 Server Windows 2000 Server 166 M H z
/ / (FC 3)...
Modbus/TCP 1.0 1999 3 29 Andy Swales Schneider [email protected] ... 2 1.... 3 2.... 3 2.1.. 3 2.2..4 2.3..4 2.4... 5 3.... 5 3.1 0... 5 3.2 1... 5 3.3 2... 6 3.4 / /... 7 4.... 7 5.... 8 5.1 0... 9
WinMDI 28
WinMDI WinMDI 2 Region Gate Marker Quadrant Excel FACScan IBM-PC MO WinMDI WinMDI IBM-PC Dr. Joseph Trotter the Scripps Research Institute WinMDI HP PC WinMDI WinMDI PC MS WORD, PowerPoint, Excel, LOTUS
逢 甲 大 學
Maple Computer Animation Fourbar Linkage Using Maple Maple Maple i Maple Maple ii Abstract "Four-Bar Linkage" is very general in our life, so we can learn the knowledge of "Four-Bar Linkage" in mobile.
ebook15-4
4 4.1 I / O I / s t a t s t a t ( ) U N I X 4.2 stat fstat lstat s t a t #include #include int stat(const char p a * t h n a m e, struct stat b * u f) ; int fstat(int f i l e
C/C++ - 字符输入输出和字符确认
C/C++ Table of contents 1. 2. getchar() putchar() 3. (Buffer) 4. 5. 6. 7. 8. 1 2 3 1 // pseudo code 2 read a character 3 while there is more input 4 increment character count 5 if a line has been read,
Lorem ipsum dolor sit amet, consectetuer adipiscing elit
English for Study in Australia 留 学 澳 洲 英 语 讲 座 Lesson 3: Make yourself at home 第 三 课 : 宾 至 如 归 L1 Male: 各 位 朋 友 好, 欢 迎 您 收 听 留 学 澳 洲 英 语 讲 座 节 目, 我 是 澳 大 利 亚 澳 洲 广 播 电 台 的 节 目 主 持 人 陈 昊 L1 Female: 各 位
本文由筱驀釹贡献
本 文 由 筱 驀 釹 贡 献 ppt 文 档 可 能 在 WAP 端 浏 览 体 验 不 佳 建 议 您 优 先 选 择 TXT, 或 下 载 源 文 件 到 本 机 查 看 Linux 操 作 系 统 Linux 操 作 系 统 第 一 部 分 介 绍 与 安 装 Linux 的 由 来 : Linux 的 由 来 : 的 由 来 Linus Torvalds 1.Linux 的 版 本 1.Linux
Microsoft Word doc
中 考 英 语 科 考 试 标 准 及 试 卷 结 构 技 术 指 标 构 想 1 王 后 雄 童 祥 林 ( 华 中 师 范 大 学 考 试 研 究 院, 武 汉,430079, 湖 北 ) 提 要 : 本 文 从 结 构 模 式 内 容 要 素 能 力 要 素 题 型 要 素 难 度 要 素 分 数 要 素 时 限 要 素 等 方 面 细 致 分 析 了 中 考 英 语 科 试 卷 结 构 的
(Microsoft Word - 5\276\302\270g\260\252\256v .doc)
問 學 第 七 期 -2004 年 高 雄 : 國 立 高 雄 師 範 大 學 國 文 系 六 祖 壇 經 及 其 語 言 研 究 考 述 邱 湘 雲 * 摘 要 禪 宗 自 唐 代 盛 行 至 今 歷 千 年 而 不 衰 六 祖 壇 經 為 禪 門 重 要 典 籍 欲 知 中 國 禪 宗 思 想 之 開 展 當 由 此 書 看 起 本 文 回 歸 文 本 考 論 壇 經 之 書 名 作 者 編 撰
I 宋 出 认 V 司 秋 通 始 司 福 用 今 给 研 除 用 墓 本 发 共 柜 又 阙 杂 既 * *" * " 利 牙 激 I * 为 无 温 乃 炉 M S H I c c *c 传 统 国 古 代 建 筑 的 砺 灰 及 其 基 本 性 质 a 开 始 用 牡 壳 煅 烧 石 灰 南
尽 对 古 证 K 避 不 B 要 尽 也 只 得 随 包 国 古 代 建 筑 的 砺 灰 及 其 基 本 性 质 传 统 国 古 代 建 筑 的 顿 灰 及 其 基 本 性 质 李 黎 张 俭 邵 明 申 提 要 灰 也 称 作 贝 壳 灰 蜊 灰 等 是 煅 烧 贝 壳 等 海 洋 生 物 得 的 氧 化 钙 为 主 要 成 分 的 材 料 灰 作 为 国 古 代 沿 海 地 区 常 用 的 建
Unix®t Œ fi z.PDF
7 9 8 0 $ man umount newfs $ man -a intro $ man -a chown ORDER=C:ADM:ADMN:ADMP:PADM:F:HW 8 1 # catman % ps aux grep chavez chavez 8684 89.5 9.627680 5280? R N 85:26 /home/j90/l988 root 10008 10.0 0.8 1408
基 督 教 培 英 中 心 園 地 培 英 中 心 動 向 地 址 :#101-8580 Cambie Road, Richmond, B.C. 電 話 :604-821-1262 傳 真 :604-821-1269 電 郵 :[email protected] 網 址 :www.puiying.or
Vancouver Pui Ying Voice 第 258 期 2014 年 1 月 20 日 目 錄 (1) 美 國 加 省 省 會 培 英 校 友 會 新 地 址, 溫 哥 華 培 英 校 友 會 今 年 活 動 ; 香 港 培 英 校 友 會 新 春 團 員 拜 信 ; (2). 基 督 教 培 英 中 心 園 地 ; (3) 紐 英 倫 培 英 校 友 共 聚 歡 慶 聖 誕 ; (4)
c36022001.pdf
1 i i i E 0 1 Eden email equality evening /'id%/ /'imel/ /i'kwal3t0/ /'ivn0h/ A sailor went to sea, sea, sea, To see what he could see, see, see. But all that he could see, see, see, Was the bottom of
蔡 氏 族 譜 序 2
1 蔡 氏 族 譜 Highlights with characters are Uncle Mike s corrections. Missing or corrected characters are found on pages 9, 19, 28, 34, 44. 蔡 氏 族 譜 序 2 3 福 建 仙 遊 赤 湖 蔡 氏 宗 譜 序 蔡 氏 之 先 出 自 姬 姓 周 文 王 第 五 子
ebook62-1
1 Red Hat Linux R e d Hat Linux L i n u x X Wi n d o w Red Hat L i n u x 1.1 Red Hat Linux Red Hat 16 M 120 M 3. 5 Intel 386 C D - R O M C D - R O M We b / 1.1.1 L i n u x L i n u 4 Primary Partition Extended
该 奈 自 受 PZ 多 透 soc i e B t h y. y t is NA YL OR exp os ed t h a t b e i n g wh o res or sa in t es s e s we r e m ad e n b ot om. M ean wh i l e NA YL
探 性 通 性 圣 重 ' 颠 并 格 洛 丽 亚 奈 勒 小 说 贝 雷 的 咖 啡 馆 对 圣 经 女 性 的 重 写 郭 晓 霞 内 容 提 要 雷 的 咖 啡 馆 中 权 社 会 支 配 的 女 性 形 象 美 国 当 代 著 名 黑 人 女 作 家 格 洛 丽 亚 过 对 6 个 圣 经 女 性 故 事 的 重 写 奈 勒 在 其 小 说 贝 覆 了 圣 经 中 被 父 揭 示 了 传 统
ebook70-19
1 9 S t a r O ff i c e Star Division S t a r O ff i c e h t t p / / w w w. s t a r d i v i s i o n. c o m S t a r O ff i c e O p e n L i n u x O p e n L i n u x StarOffice S t a r O ff i c e S t a r O
LOVE IS OVER LOVE LOVE LOVE LOVE IS EVERYTHING LOVE LOVE LOVE LOVER'S QUEEN LYDIA MAYBE TOMORROW MEN'S TALK MY DEAR MY FRIEND MY OH MY MY SUMMER DREAM
曲名 1234 20.30.40 5678 GOING 929 9907 A BTTER DAY ANDY BABY I'M YOUR MAN BACK HOME BAD BOY BEAUTIFUL GIRL BABY BABY BACK HOME BEAUTIFUL DAY BECAUSE OF YOU BETTER MAN CAN'T STOP LOVING YOU CALL ME CAN YOU
ebook204-2
Internet Information Services 2 I I S 5 We b We b I I S IIS 5 M i c r o s o f t M i c r o s o f t Active Server Pages A S P We b IIS 5 IIS 5 3 We b IIS 5 We b Microsoft Solutions Framework M S F M S F
中文核心期刊要目总览-(2004年版) 简明目录
中 文 核 心 期 刊 要 目 总 览 (2004 年 版 ) 简 明 目 录 第 一 编 第 二 编 第 三 编 第 四 编 第 五 编 第 六 编 第 七 编 哲 学 社 会 学 政 治 法 律 军 事 经 济 文 化 教 育 历 史 自 然 科 学 医 药 卫 生 农 业 科 学 工 业 技 术 第 一 编 哲 学 社 会 学 政 治 法 律 军 事 A/K 综 合 性 人 文 社 会 科 学
epub83-1
C++Builder 1 C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r 1.1 1.1.1 1-1 1. 1-1 1 2. 1-1 2 A c c e s s P a r a d o x Visual FoxPro 3. / C / S 2 C + + B u i l d e r / C
Untitiled
目 立人1 2011 录 目 录 专家视点 权利与责任 班主任批评权的有效运用 齐学红 3 德育园地 立 沿着鲁迅爷爷的足迹 主题队活动案例 郑海娟 4 播下一颗美丽的种子 沿着鲁迅爷爷的足迹 中队活动反思 郑海娟 5 赠人玫瑰 手有余香 关于培养小学生服务意识的一些尝试和思考 孙 勤 6 人 教海纵横 2011 年第 1 期 总第 9 期 主办单位 绍兴市鲁迅小学教育集团 顾 问 编委会主任 编
ebook177-1
1 1968 A R PA N E T A R PA N E T 1 9 7 3 Ly n c h R o s e Internet system Handbook ( 1993 ) David Croker R F C Request for Comment 1969 R F C R F C M O 1969 1974 A R PA N E T 1977 I E N T C P / I P 1986
<D0A1B0E02E707562>
小 一 班 专 题 活 动 生 日 蛋 糕 生 日 蛋 糕 是 孩 子 们 最 喜 欢 的 食 物, 他 们 期 盼 着 每 次 生 日 的 到 来 吹 蜡 烛 许 心 愿 吃 蛋 糕, 经 常 出 现 在 孩 子 们 的 区 域 游 戏 中, 因 此, 我 们 确 定 了 本 次 专 题 研 习 的 方 向 生 日 蛋 糕 结 合 专 题 探 究 的 需 要,11 月 10 日 我 们 同 孩 子
ebook14-4
4 TINY LL(1) First F o l l o w t o p - d o w n 3 3. 3 backtracking parser predictive parser recursive-descent parsing L L ( 1 ) LL(1) parsing L L ( 1 ) L L ( 1 ) 1 L 2 L 1 L L ( k ) k L L ( 1 ) F i r s
ebook45-5
5 S Q L SQL Server 5.1 5-1 SQL Server 5-1 A B S A C O S A S I N ATA N AT N 2 C E I L I N G C O S C O T D E G R E E S E X P F L O O R L O G L O G 10 P I P O W E R R A D I A N S R A N D R O U N D S I G N
RSBook_CN.indb
User s Guide www.rst.cn???????? VERSION 2 User s Guide VERSION 2 RosettaStone 2003 Fairfield Language Technologies RosettaStone Fairfield Language Technologies Bodoni Cyrillic Casady & Greene RosettaStone
ebook2-24
2 4 24 24 2 4 We b 24 24 24.1 We b Job Opening We b E x c i t e 24-1 E x c i t e C a r e e r s 290 C a r e e r s, 24-1 w w w. e x c i t e. c o m E x c i t e C a r e e r Excite Careers M o n s t e r. c
untitled
01 1-1 PHP 1-2 PHP 1-3 MySQL 1-4 1-5 http://w3techs.com/technologies/history_overview/programming_language w3techs.com (Server-side) 2012 7 77.8% PHP PHP PHP PHP 1-1 PHP PHP HTML Script Windows ASP(Active
