home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / a_utils / perl / mac-perl / mcprl401.bin / Perl_appl / PerlHelp < prev    next >
MacBinary  |  1993-07-25  |  224.1 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Wed Jul 24 13:20:09 2024, modified Wed Jul 24 13:20:09 2024, creator 'MPS ', type ASCII, 228628 bytes "PerlHelp" , at 0x37d94 549 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 50 65 72 6c 48 65 | 6c 70 00 00 00 00 00 00 |..PerlHe|lp......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 03 7d 14 00 | 00 02 25 e2 c6 e8 49 e2 |.....}..|..%...I.|
|00000060| c6 e8 49 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..I.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 28 bf 00 00 |........|....(...|
|00000080| be 4b 59 20 43 6f 70 79 | 72 69 67 68 74 4e 6f 74 |.KY Copy|rightNot|
|00000090| 69 63 65 0d be 43 20 20 | 4c 61 72 72 79 20 57 61 |ice..C |Larry Wa|
|000000a0| 6c 6c 20 3c 6c 77 61 6c | 6c 40 6e 65 74 6c 61 62 |ll <lwal|l@netlab|
|000000b0| 73 2e 63 6f 6d 3e 0d 4d | 61 63 69 6e 74 6f 73 68 |s.com>.M|acintosh|
|000000c0| 20 70 6f 72 74 20 62 79 | 20 0d 0d 20 20 20 4d 61 | port by| .. Ma|
|000000d0| 74 74 68 69 61 73 20 4e | 65 65 72 61 63 68 65 72 |tthias N|eeracher|
|000000e0| 20 3c 6e 65 65 72 69 40 | 69 69 73 2e 65 74 68 7a | <neeri@|iis.ethz|
|000000f0| 2e 63 68 3e 0d 20 20 20 | 54 69 6d 20 45 6e 64 72 |.ch>. |Tim Endr|
|00000100| 65 73 20 20 20 20 20 20 | 20 20 20 3c 74 69 6d 65 |es | <time|
|00000110| 40 69 63 65 2e 63 6f 6d | 3e 0d 0d be 4b 59 20 48 |@ice.com|>...KY H|
|00000120| 65 6c 70 0d 50 65 72 6c | 48 65 6c 70 0d be 4b 4c |elp.Perl|Help..KL|
|00000130| 20 41 62 6f 75 74 c9 50 | 65 72 6c 0d 50 65 72 6c | About.P|erl.Perl|
|00000140| c9 4f 70 74 69 6f 6e 73 | 0d 50 65 72 6c c9 54 79 |.Options|.Perl.Ty|
|00000150| 70 65 73 0d 50 65 72 6c | c9 53 79 6e 74 61 78 0d |pes.Perl|.Syntax.|
|00000160| 50 65 72 6c c9 43 6f 6d | 70 6f 75 6e 64 c9 53 74 |Perl.Com|pound.St|
|00000170| 61 74 65 6d 65 6e 74 73 | 0d 50 65 72 6c c9 53 69 |atements|.Perl.Si|
|00000180| 6d 70 6c 65 c9 53 74 61 | 74 65 6d 65 6e 74 73 0d |mple.Sta|tements.|
|00000190| 50 65 72 6c c9 45 78 70 | 72 65 73 73 69 6f 6e 73 |Perl.Exp|ressions|
|000001a0| 0d 50 65 72 6c c9 4f 70 | 65 72 61 74 6f 72 73 0d |.Perl.Op|erators.|
|000001b0| 50 65 72 6c c9 50 72 65 | 63 65 64 65 6e 63 65 0d |Perl.Pre|cedence.|
|000001c0| 50 65 72 6c c9 53 75 62 | 72 6f 75 74 69 6e 65 73 |Perl.Sub|routines|
|000001d0| 0d 50 65 72 6c c9 52 65 | 67 65 78 70 0d 50 65 72 |.Perl.Re|gexp.Per|
|000001e0| 6c c9 46 6f 72 6d 61 74 | 73 0d 50 65 72 6c c9 49 |l.Format|s.Perl.I|
|000001f0| 50 43 0d 50 65 72 6c c9 | 56 61 72 69 61 62 6c 65 |PC.Perl.|Variable|
|00000200| 73 0d 50 65 72 6c c9 50 | 61 63 6b 61 67 65 73 0d |s.Perl.P|ackages.|
|00000210| 50 65 72 6c c9 53 74 79 | 6c 65 0d 50 65 72 6c c9 |Perl.Sty|le.Perl.|
|00000220| 44 65 62 75 67 67 69 6e | 67 0d 50 65 72 6c c9 45 |Debuggin|g.Perl.E|
|00000230| 6e 76 69 72 6f 6e 6d 65 | 6e 74 0d 50 65 72 6c c9 |nvironme|nt.Perl.|
|00000240| 44 69 61 67 6e 6f 73 74 | 69 63 73 0d 50 65 72 6c |Diagnost|ics.Perl|
|00000250| c9 54 72 61 70 73 0d 50 | 65 72 6c c9 45 72 72 61 |.Traps.P|erl.Erra|
|00000260| 74 61 0d 50 65 72 6c c9 | 42 75 67 73 0d 50 65 72 |ta.Perl.|Bugs.Per|
|00000270| 6c c9 4d 61 63 69 6e 74 | 6f 73 68 c9 45 78 74 65 |l.Macint|osh.Exte|
|00000280| 6e 73 69 6f 6e 73 0d 0d | 61 63 63 65 70 74 0d 61 |nsions..|accept.a|
|00000290| 6c 61 72 6d 0d 61 74 61 | 6e 32 0d 62 69 6e 64 0d |larm.ata|n2.bind.|
|000002a0| 62 69 6e 6d 6f 64 65 0d | 63 61 6c 6c 65 72 0d 63 |binmode.|caller.c|
|000002b0| 68 64 69 72 0d 63 68 6d | 6f 64 0d 63 68 6f 6f 73 |hdir.chm|od.choos|
|000002c0| 65 0d 63 68 6f 70 0d 63 | 68 6f 77 6e 0d 63 68 72 |e.chop.c|hown.chr|
|000002d0| 6f 6f 74 0d 63 6c 6f 73 | 65 0d 63 6c 6f 73 65 64 |oot.clos|e.closed|
|000002e0| 69 72 0d 63 6f 6e 6e 65 | 63 74 0d 63 6f 73 0d 63 |ir.conne|ct.cos.c|
|000002f0| 72 79 70 74 0d 64 62 6d | 63 6c 6f 73 65 0d 64 62 |rypt.dbm|close.db|
|00000300| 6d 6f 70 65 6e 0d 64 65 | 66 69 6e 65 64 0d 64 65 |mopen.de|fined.de|
|00000310| 6c 65 74 65 0d 64 69 65 | 0d 64 6f 0d 64 75 6d 70 |lete.die|.do.dump|
|00000320| 0d 65 61 63 68 0d 65 6e | 64 68 6f 73 74 65 6e 74 |.each.en|dhostent|
|00000330| 0d 65 6e 64 70 72 6f 74 | 6f 65 6e 74 0d 65 6e 64 |.endprot|oent.end|
|00000340| 73 65 72 76 65 6e 74 0d | 65 6f 66 0d 65 76 61 6c |servent.|eof.eval|
|00000350| 0d 65 78 65 63 0d 65 78 | 69 74 0d 65 78 70 0d 66 |.exec.ex|it.exp.f|
|00000360| 63 6e 74 6c 0d 66 69 6c | 65 6e 6f 0d 66 6c 6f 63 |cntl.fil|eno.floc|
|00000370| 6b 0d 66 6f 72 6b 0d 67 | 65 74 63 0d 67 65 74 68 |k.fork.g|etc.geth|
|00000380| 6f 73 74 62 79 61 64 64 | 72 0d 67 65 74 68 6f 73 |ostbyadd|r.gethos|
|00000390| 74 62 79 6e 61 6d 65 0d | 67 65 74 68 6f 73 74 65 |tbyname.|gethoste|
|000003a0| 6e 74 0d 67 65 74 6c 6f | 67 69 6e 0d 67 65 74 70 |nt.getlo|gin.getp|
|000003b0| 65 65 72 6e 61 6d 65 0d | 67 65 74 70 72 6f 74 6f |eername.|getproto|
|000003c0| 62 79 6e 61 6d 65 0d 67 | 65 74 70 72 6f 74 6f 62 |byname.g|etprotob|
|000003d0| 79 6e 75 6d 62 65 72 0d | 67 65 74 70 72 6f 74 6f |ynumber.|getproto|
|000003e0| 65 6e 74 0d 67 65 74 73 | 65 72 76 62 79 6e 61 6d |ent.gets|ervbynam|
|000003f0| 65 0d 67 65 74 73 65 72 | 76 62 79 70 6f 72 74 0d |e.getser|vbyport.|
|00000400| 67 65 74 73 65 72 76 65 | 6e 74 0d 67 65 74 73 6f |getserve|nt.getso|
|00000410| 63 6b 6e 61 6d 65 0d 67 | 65 74 73 6f 63 6b 6f 70 |ckname.g|etsockop|
|00000420| 74 0d 67 6d 74 69 6d 65 | 0d 67 6f 74 6f 0d 67 72 |t.gmtime|.goto.gr|
|00000430| 65 70 0d 68 65 78 0d 69 | 6e 64 65 78 0d 69 6e 74 |ep.hex.i|ndex.int|
|00000440| 0d 69 6f 63 74 6c 0d 6a | 6f 69 6e 0d 6b 65 79 73 |.ioctl.j|oin.keys|
|00000450| 0d 6b 69 6c 6c 0d 6c 61 | 73 74 0d 6c 65 6e 67 74 |.kill.la|st.lengt|
|00000460| 68 0d 6c 69 6e 6b 0d 6c | 69 73 74 65 6e 0d 6c 6f |h.link.l|isten.lo|
|00000470| 63 61 6c 0d 6c 6f 63 61 | 6c 74 69 6d 65 0d 6c 6f |cal.loca|ltime.lo|
|00000480| 67 0d 6c 73 74 61 74 0d | 6d 0d 6d 6b 64 69 72 0d |g.lstat.|m.mkdir.|
|00000490| 6d 73 67 63 74 6c 0d 6d | 73 67 67 65 74 0d 6d 73 |msgctl.m|sgget.ms|
|000004a0| 67 72 63 76 0d 6d 73 67 | 73 6e 64 0d 6e 65 78 74 |grcv.msg|snd.next|
|000004b0| 0d 6f 63 74 0d 6f 70 65 | 6e 0d 6f 70 65 6e 64 69 |.oct.ope|n.opendi|
|000004c0| 72 0d 6f 72 64 0d 70 61 | 63 6b 0d 70 69 70 65 0d |r.ord.pa|ck.pipe.|
|000004d0| 70 6f 70 0d 70 72 69 6e | 74 0d 70 72 69 6e 74 66 |pop.prin|t.printf|
|000004e0| 0d 70 75 73 68 0d 71 0d | 72 61 6e 64 0d 72 65 61 |.push.q.|rand.rea|
|000004f0| 64 0d 72 65 61 64 64 69 | 72 0d 72 65 61 64 6c 69 |d.readdi|r.readli|
|00000500| 6e 6b 0d 72 65 63 76 0d | 72 65 64 6f 0d 72 65 6e |nk.recv.|redo.ren|
|00000510| 61 6d 65 0d 72 65 71 75 | 69 72 65 0d 72 65 73 65 |ame.requ|ire.rese|
|00000520| 74 0d 72 65 74 75 72 6e | 0d 72 65 76 65 72 73 65 |t.return|.reverse|
|00000530| 0d 72 65 77 69 6e 64 64 | 69 72 0d 72 69 6e 64 65 |.rewindd|ir.rinde|
|00000540| 78 0d 72 6d 64 69 72 0d | 73 0d 73 63 61 6c 61 72 |x.rmdir.|s.scalar|
|00000550| 0d 73 65 65 6b 0d 73 65 | 65 6b 64 69 72 0d 73 65 |.seek.se|ekdir.se|
|00000560| 6c 65 63 74 0d 73 65 6d | 63 74 6c 0d 73 65 6d 67 |lect.sem|ctl.semg|
|00000570| 65 74 0d 73 65 6d 6f 70 | 0d 73 65 6e 64 0d 73 65 |et.semop|.send.se|
|00000580| 74 67 72 65 6e 74 0d 73 | 65 74 68 6f 73 74 65 6e |tgrent.s|ethosten|
|00000590| 74 0d 73 65 74 6e 65 74 | 65 6e 74 0d 73 65 74 70 |t.setnet|ent.setp|
|000005a0| 67 72 70 0d 73 65 74 70 | 72 69 6f 72 69 74 79 0d |grp.setp|riority.|
|000005b0| 73 65 74 70 72 6f 74 6f | 65 6e 74 0d 73 65 74 70 |setproto|ent.setp|
|000005c0| 77 65 6e 74 0d 73 65 74 | 73 65 72 76 65 6e 74 0d |went.set|servent.|
|000005d0| 73 65 74 73 6f 63 6b 6f | 70 74 0d 73 68 69 66 74 |setsocko|pt.shift|
|000005e0| 0d 73 68 6d 63 74 6c 0d | 73 68 6d 67 65 74 0d 73 |.shmctl.|shmget.s|
|000005f0| 68 6d 72 65 61 64 0d 73 | 68 75 74 64 6f 77 6e 0d |hmread.s|hutdown.|
|00000600| 73 69 6e 0d 73 6c 65 65 | 70 0d 73 6f 63 6b 65 74 |sin.slee|p.socket|
|00000610| 0d 73 6f 63 6b 65 74 70 | 61 69 72 0d 73 6f 72 74 |.socketp|air.sort|
|00000620| 0d 73 70 6c 69 63 65 0d | 73 70 6c 69 74 0d 73 70 |.splice.|split.sp|
|00000630| 72 69 6e 74 66 0d 73 71 | 72 74 0d 73 72 61 6e 64 |rintf.sq|rt.srand|
|00000640| 0d 73 74 61 74 0d 73 74 | 75 64 79 0d 73 75 62 73 |.stat.st|udy.subs|
|00000650| 74 72 0d 73 79 6d 6c 69 | 6e 6b 0d 73 79 73 63 61 |tr.symli|nk.sysca|
|00000660| 6c 6c 0d 73 79 73 72 65 | 61 64 0d 73 79 73 74 65 |ll.sysre|ad.syste|
|00000670| 6d 0d 73 79 73 77 72 69 | 74 65 0d 74 65 6c 6c 0d |m.syswri|te.tell.|
|00000680| 74 65 6c 6c 64 69 72 0d | 74 69 6d 65 0d 74 69 6d |telldir.|time.tim|
|00000690| 65 73 0d 74 72 0d 74 72 | 75 6e 63 61 74 65 0d 75 |es.tr.tr|uncate.u|
|000006a0| 6d 61 73 6b 0d 75 6e 64 | 65 66 0d 75 6e 6c 69 6e |mask.und|ef.unlin|
|000006b0| 6b 0d 75 6e 70 61 63 6b | 0d 75 6e 73 68 69 66 74 |k.unpack|.unshift|
|000006c0| 0d 75 74 69 6d 65 0d 76 | 61 6c 75 65 73 0d 76 65 |.utime.v|alues.ve|
|000006d0| 63 0d 77 61 69 74 0d 77 | 61 69 74 70 69 64 0d 77 |c.wait.w|aitpid.w|
|000006e0| 61 6e 74 61 72 72 61 79 | 0d 77 61 72 6e 0d 77 72 |antarray|.warn.wr|
|000006f0| 69 74 65 0d be 4b 59 20 | 50 65 72 6c 0d 41 62 6f |ite..KY |Perl.Abo|
|00000700| 75 74 c9 50 65 72 6c 0d | be 43 0d 50 65 72 6c 20 |ut.Perl.|.C.Perl |
|00000710| 2d 2d 20 50 72 61 63 74 | 69 63 61 6c 20 45 78 74 |-- Pract|ical Ext|
|00000720| 72 61 63 74 69 6f 6e 20 | 61 6e 64 20 52 65 70 6f |raction |and Repo|
|00000730| 72 74 20 4c 61 6e 67 75 | 61 67 65 0d 0d 50 65 72 |rt Langu|age..Per|
|00000740| 6c 20 69 73 20 61 6e 20 | 69 6e 74 65 72 70 72 65 |l is an |interpre|
|00000750| 74 65 64 20 6c 61 6e 67 | 75 61 67 65 20 6f 70 74 |ted lang|uage opt|
|00000760| 69 6d 69 7a 65 64 20 66 | 6f 72 20 73 63 61 6e 6e |imized f|or scann|
|00000770| 69 6e 67 20 61 72 62 69 | 74 72 61 72 79 0d 74 65 |ing arbi|trary.te|
|00000780| 78 74 20 66 69 6c 65 73 | 2c 20 65 78 74 72 61 63 |xt files|, extrac|
|00000790| 74 69 6e 67 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |ting inf|ormation|
|000007a0| 20 66 72 6f 6d 20 74 68 | 6f 73 65 20 74 65 78 74 | from th|ose text|
|000007b0| 20 66 69 6c 65 73 2c 20 | 61 6e 64 0d 70 72 69 6e | files, |and.prin|
|000007c0| 74 69 6e 67 20 72 65 70 | 6f 72 74 73 20 62 61 73 |ting rep|orts bas|
|000007d0| 65 64 20 6f 6e 20 74 68 | 61 74 20 69 6e 66 6f 72 |ed on th|at infor|
|000007e0| 6d 61 74 69 6f 6e 2e 20 | 49 74 27 73 20 61 6c 73 |mation. |It's als|
|000007f0| 6f 20 61 20 67 6f 6f 64 | 0d 6c 61 6e 67 75 61 67 |o a good|.languag|
|00000800| 65 20 66 6f 72 20 6d 61 | 6e 79 20 73 79 73 74 65 |e for ma|ny syste|
|00000810| 6d 20 6d 61 6e 61 67 65 | 6d 65 6e 74 20 74 61 73 |m manage|ment tas|
|00000820| 6b 73 2e 20 54 68 65 20 | 6c 61 6e 67 75 61 67 65 |ks. The |language|
|00000830| 20 69 73 20 69 6e 74 65 | 6e 64 65 64 0d 74 6f 20 | is inte|nded.to |
|00000840| 62 65 20 70 72 61 63 74 | 69 63 61 6c 20 28 65 61 |be pract|ical (ea|
|00000850| 73 79 20 74 6f 20 75 73 | 65 2c 20 65 66 66 69 63 |sy to us|e, effic|
|00000860| 69 65 6e 74 2c 20 63 6f | 6d 70 6c 65 74 65 29 20 |ient, co|mplete) |
|00000870| 72 61 74 68 65 72 20 74 | 68 61 6e 0d 62 65 61 75 |rather t|han.beau|
|00000880| 74 69 66 75 6c 20 28 74 | 69 6e 79 2c 20 65 6c 65 |tiful (t|iny, ele|
|00000890| 67 61 6e 74 2c 20 6d 69 | 6e 69 6d 61 6c 29 2e 20 |gant, mi|nimal). |
|000008a0| 20 49 74 20 63 6f 6d 62 | 69 6e 65 73 20 28 69 6e | It comb|ines (in|
|000008b0| 20 74 68 65 20 61 75 74 | 68 6f 72 27 73 0d 6f 70 | the aut|hor's.op|
|000008c0| 69 6e 69 6f 6e 2c 20 61 | 6e 79 77 61 79 29 20 73 |inion, a|nyway) s|
|000008d0| 6f 6d 65 20 6f 66 20 74 | 68 65 20 62 65 73 74 20 |ome of t|he best |
|000008e0| 66 65 61 74 75 72 65 73 | 20 6f 66 20 43 2c 20 73 |features| of C, s|
|000008f0| 65 64 2c 20 61 77 6b 2c | 20 61 6e 64 20 73 68 2c |ed, awk,| and sh,|
|00000900| 0d 73 6f 20 70 65 6f 70 | 6c 65 20 66 61 6d 69 6c |.so peop|le famil|
|00000910| 69 61 72 20 77 69 74 68 | 20 74 68 6f 73 65 20 6c |iar with| those l|
|00000920| 61 6e 67 75 61 67 65 73 | 20 73 68 6f 75 6c 64 20 |anguages| should |
|00000930| 68 61 76 65 20 6c 69 74 | 74 6c 65 0d 64 69 66 66 |have lit|tle.diff|
|00000940| 69 63 75 6c 74 79 20 77 | 69 74 68 20 69 74 2e 20 |iculty w|ith it. |
|00000950| 20 28 4c 61 6e 67 75 61 | 67 65 20 68 69 73 74 6f | (Langua|ge histo|
|00000960| 72 69 61 6e 73 20 77 69 | 6c 6c 20 61 6c 73 6f 20 |rians wi|ll also |
|00000970| 6e 6f 74 65 20 73 6f 6d | 65 0d 76 65 73 74 69 67 |note som|e.vestig|
|00000980| 65 73 20 6f 66 20 63 73 | 68 2c 20 50 61 73 63 61 |es of cs|h, Pasca|
|00000990| 6c 2c 20 61 6e 64 20 65 | 76 65 6e 20 42 41 53 49 |l, and e|ven BASI|
|000009a0| 43 2d 50 4c 55 53 2e 29 | 20 45 78 70 72 65 73 73 |C-PLUS.)| Express|
|000009b0| 69 6f 6e 20 73 79 6e 74 | 61 78 0d 63 6f 72 72 65 |ion synt|ax.corre|
|000009c0| 73 70 6f 6e 64 73 20 71 | 75 69 74 65 20 63 6c 6f |sponds q|uite clo|
|000009d0| 73 65 6c 79 20 74 6f 20 | 43 20 65 78 70 72 65 73 |sely to |C expres|
|000009e0| 73 69 6f 6e 20 73 79 6e | 74 61 78 2e 20 55 6e 6c |sion syn|tax. Unl|
|000009f0| 69 6b 65 20 6d 6f 73 74 | 20 55 6e 69 78 0d 75 74 |ike most| Unix.ut|
|00000a00| 69 6c 69 74 69 65 73 2c | 20 70 65 72 6c 20 64 6f |ilities,| perl do|
|00000a10| 65 73 20 6e 6f 74 20 61 | 72 62 69 74 72 61 72 69 |es not a|rbitrari|
|00000a20| 6c 79 20 6c 69 6d 69 74 | 20 74 68 65 20 73 69 7a |ly limit| the siz|
|00000a30| 65 20 6f 66 20 79 6f 75 | 72 20 64 61 74 61 2d 2d |e of you|r data--|
|00000a40| 69 66 0d 79 6f 75 27 76 | 65 20 67 6f 74 20 74 68 |if.you'v|e got th|
|00000a50| 65 20 6d 65 6d 6f 72 79 | 2c 20 70 65 72 6c 20 63 |e memory|, perl c|
|00000a60| 61 6e 20 73 6c 75 72 70 | 20 69 6e 20 79 6f 75 72 |an slurp| in your|
|00000a70| 20 77 68 6f 6c 65 20 66 | 69 6c 65 20 61 73 20 61 | whole f|ile as a|
|00000a80| 20 73 69 6e 67 6c 65 0d | 73 74 72 69 6e 67 2e 20 | single.|string. |
|00000a90| 52 65 63 75 72 73 69 6f | 6e 20 69 73 20 6f 66 20 |Recursio|n is of |
|00000aa0| 75 6e 6c 69 6d 69 74 65 | 64 20 64 65 70 74 68 2e |unlimite|d depth.|
|00000ab0| 20 20 41 6e 64 20 74 68 | 65 20 68 61 73 68 20 74 | And th|e hash t|
|00000ac0| 61 62 6c 65 73 20 75 73 | 65 64 20 62 79 0d 61 73 |ables us|ed by.as|
|00000ad0| 73 6f 63 69 61 74 69 76 | 65 20 61 72 72 61 79 73 |sociativ|e arrays|
|00000ae0| 20 67 72 6f 77 20 61 73 | 20 6e 65 63 65 73 73 61 | grow as| necessa|
|00000af0| 72 79 20 74 6f 20 70 72 | 65 76 65 6e 74 20 64 65 |ry to pr|event de|
|00000b00| 67 72 61 64 65 64 20 70 | 65 72 66 6f 72 6d 61 6e |graded p|erforman|
|00000b10| 63 65 2e 0d 50 65 72 6c | 20 75 73 65 73 20 73 6f |ce..Perl| uses so|
|00000b20| 70 68 69 73 74 69 2d 20 | 63 61 74 65 64 20 70 61 |phisti- |cated pa|
|00000b30| 74 74 65 72 6e 20 6d 61 | 74 63 68 69 6e 67 20 74 |ttern ma|tching t|
|00000b40| 65 63 68 6e 69 71 75 65 | 73 20 74 6f 20 73 63 61 |echnique|s to sca|
|00000b50| 6e 20 6c 61 72 67 65 0d | 61 6d 6f 75 6e 74 73 20 |n large.|amounts |
|00000b60| 6f 66 20 64 61 74 61 20 | 76 65 72 79 20 71 75 69 |of data |very qui|
|00000b70| 63 6b 6c 79 2e 20 41 6c | 74 68 6f 75 67 68 20 6f |ckly. Al|though o|
|00000b80| 70 74 69 6d 69 7a 65 64 | 20 66 6f 72 20 73 63 61 |ptimized| for sca|
|00000b90| 6e 6e 69 6e 67 20 74 65 | 78 74 2c 0d 70 65 72 6c |nning te|xt,.perl|
|00000ba0| 20 63 61 6e 20 61 6c 73 | 6f 20 64 65 61 6c 20 77 | can als|o deal w|
|00000bb0| 69 74 68 20 62 69 6e 61 | 72 79 20 64 61 74 61 2c |ith bina|ry data,|
|00000bc0| 20 61 6e 64 20 63 61 6e | 20 6d 61 6b 65 20 64 62 | and can| make db|
|00000bd0| 6d 20 66 69 6c 65 73 20 | 6c 6f 6f 6b 20 6c 69 6b |m files |look lik|
|00000be0| 65 0d 61 73 73 6f 63 69 | 61 74 69 76 65 20 61 72 |e.associ|ative ar|
|00000bf0| 72 61 79 73 20 28 77 68 | 65 72 65 20 64 62 6d 20 |rays (wh|ere dbm |
|00000c00| 69 73 20 61 76 61 69 6c | 61 62 6c 65 29 2e 20 53 |is avail|able). S|
|00000c10| 65 74 75 69 64 20 70 65 | 72 6c 20 73 63 72 69 70 |etuid pe|rl scrip|
|00000c20| 74 73 20 61 72 65 0d 73 | 61 66 65 72 20 74 68 61 |ts are.s|afer tha|
|00000c30| 6e 20 43 20 70 72 6f 67 | 72 61 6d 73 20 74 68 72 |n C prog|rams thr|
|00000c40| 6f 75 67 68 20 61 20 64 | 61 74 61 66 6c 6f 77 20 |ough a d|ataflow |
|00000c50| 74 72 61 63 69 6e 67 20 | 6d 65 63 68 61 6e 69 73 |tracing |mechanis|
|00000c60| 6d 20 77 68 69 63 68 0d | 70 72 65 76 65 6e 74 73 |m which.|prevents|
|00000c70| 20 6d 61 6e 79 20 73 74 | 75 70 69 64 20 73 65 63 | many st|upid sec|
|00000c80| 75 72 69 74 79 20 68 6f | 6c 65 73 2e 20 20 49 66 |urity ho|les. If|
|00000c90| 20 79 6f 75 20 68 61 76 | 65 20 61 20 70 72 6f 62 | you hav|e a prob|
|00000ca0| 6c 65 6d 20 74 68 61 74 | 0d 77 6f 75 6c 64 20 6f |lem that|.would o|
|00000cb0| 72 64 69 6e 61 72 69 6c | 79 20 75 73 65 20 73 65 |rdinaril|y use se|
|00000cc0| 64 20 6f 72 20 61 77 6b | 20 6f 72 20 73 68 2c 20 |d or awk| or sh, |
|00000cd0| 62 75 74 20 69 74 20 65 | 78 63 65 65 64 73 20 74 |but it e|xceeds t|
|00000ce0| 68 65 69 72 0d 63 61 70 | 61 62 69 6c 69 74 69 65 |heir.cap|abilitie|
|00000cf0| 73 20 6f 72 20 6d 75 73 | 74 20 72 75 6e 20 61 20 |s or mus|t run a |
|00000d00| 6c 69 74 74 6c 65 20 66 | 61 73 74 65 72 2c 20 61 |little f|aster, a|
|00000d10| 6e 64 20 79 6f 75 20 64 | 6f 6e 27 74 20 77 61 6e |nd you d|on't wan|
|00000d20| 74 20 74 6f 20 77 72 69 | 74 65 0d 74 68 65 20 73 |t to wri|te.the s|
|00000d30| 69 6c 6c 79 20 74 68 69 | 6e 67 20 69 6e 20 43 2c |illy thi|ng in C,|
|00000d40| 20 74 68 65 6e 20 70 65 | 72 6c 20 6d 61 79 20 62 | then pe|rl may b|
|00000d50| 65 20 66 6f 72 20 79 6f | 75 2e 20 20 54 68 65 72 |e for yo|u. Ther|
|00000d60| 65 20 61 72 65 20 61 6c | 73 6f 0d 74 72 61 6e 73 |e are al|so.trans|
|00000d70| 6c 61 74 6f 72 73 20 74 | 6f 20 74 75 72 6e 20 79 |lators t|o turn y|
|00000d80| 6f 75 72 20 73 65 64 20 | 61 6e 64 20 61 77 6b 20 |our sed |and awk |
|00000d90| 73 63 72 69 70 74 73 20 | 69 6e 74 6f 20 70 65 72 |scripts |into per|
|00000da0| 6c 20 73 63 72 69 70 74 | 73 2e 0d 4f 4b 2c 20 65 |l script|s..OK, e|
|00000db0| 6e 6f 75 67 68 20 68 79 | 70 65 2e 0d 0d 55 70 6f |nough hy|pe...Upo|
|00000dc0| 6e 20 73 74 61 72 74 75 | 70 2c 20 70 65 72 6c 20 |n startu|p, perl |
|00000dd0| 6c 6f 6f 6b 73 20 66 6f | 72 20 79 6f 75 72 20 73 |looks fo|r your s|
|00000de0| 63 72 69 70 74 20 69 6e | 20 6f 6e 65 20 6f 66 20 |cript in| one of |
|00000df0| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 0d 70 6c |the foll|owing.pl|
|00000e00| 61 63 65 73 3a 0d 0d 31 | 2e 20 20 53 70 65 63 69 |aces:..1|. Speci|
|00000e10| 66 69 65 64 20 6c 69 6e | 65 20 62 79 20 6c 69 6e |fied lin|e by lin|
|00000e20| 65 20 76 69 61 20 2d 65 | 20 73 77 69 74 63 68 65 |e via -e| switche|
|00000e30| 73 20 6f 6e 20 74 68 65 | 20 63 6f 6d 6d 61 6e 64 |s on the| command|
|00000e40| 20 6c 69 6e 65 2e 0d 0d | 32 2e 20 20 43 6f 6e 74 | line...|2. Cont|
|00000e50| 61 69 6e 65 64 20 69 6e | 20 74 68 65 20 66 69 6c |ained in| the fil|
|00000e60| 65 20 73 70 65 63 69 66 | 69 65 64 20 62 79 20 74 |e specif|ied by t|
|00000e70| 68 65 20 66 69 72 73 74 | 20 66 69 6c 65 6e 61 6d |he first| filenam|
|00000e80| 65 20 6f 6e 20 74 68 65 | 0d 20 20 20 20 63 6f 6d |e on the|. com|
|00000e90| 6d 61 6e 64 20 6c 69 6e | 65 2e 20 20 28 4e 6f 74 |mand lin|e. (Not|
|00000ea0| 65 20 74 68 61 74 20 73 | 79 73 74 65 6d 73 20 73 |e that s|ystems s|
|00000eb0| 75 70 70 6f 72 74 69 6e | 67 20 74 68 65 20 23 21 |upportin|g the #!|
|00000ec0| 20 6e 6f 74 61 74 69 6f | 6e 0d 20 20 20 20 69 6e | notatio|n. in|
|00000ed0| 76 6f 6b 65 20 69 6e 74 | 65 72 70 72 65 74 65 72 |voke int|erpreter|
|00000ee0| 73 20 74 68 69 73 20 77 | 61 79 2e 29 0d 0d 33 2e |s this w|ay.)..3.|
|00000ef0| 20 20 50 61 73 73 65 64 | 20 69 6e 20 69 6d 70 6c | Passed| in impl|
|00000f00| 69 63 69 74 6c 79 20 76 | 69 61 20 73 74 61 6e 64 |icitly v|ia stand|
|00000f10| 61 72 64 20 69 6e 70 75 | 74 2e 20 20 54 68 69 73 |ard inpu|t. This|
|00000f20| 20 6f 6e 6c 79 20 77 6f | 72 6b 73 20 69 66 0d 20 | only wo|rks if. |
|00000f30| 20 20 20 74 68 65 72 65 | 20 61 72 65 20 6e 6f 20 | there| are no |
|00000f40| 66 69 6c 65 6e 61 6d 65 | 20 61 72 67 75 6d 65 6e |filename| argumen|
|00000f50| 74 73 2d 2d 74 6f 20 70 | 61 73 73 20 61 72 67 75 |ts--to p|ass argu|
|00000f60| 6d 65 6e 74 73 20 74 6f | 20 61 20 73 74 64 69 6e |ments to| a stdin|
|00000f70| 0d 20 20 20 20 73 63 72 | 69 70 74 20 79 6f 75 20 |. scr|ipt you |
|00000f80| 6d 75 73 74 20 65 78 70 | 6c 69 63 69 74 6c 79 20 |must exp|licitly |
|00000f90| 73 70 65 63 69 66 79 20 | 61 20 2d 20 66 6f 72 20 |specify |a - for |
|00000fa0| 74 68 65 20 73 63 72 69 | 70 74 20 6e 61 6d 65 2e |the scri|pt name.|
|00000fb0| 0d 0d 41 66 74 65 72 20 | 6c 6f 63 61 74 69 6e 67 |..After |locating|
|00000fc0| 20 79 6f 75 72 20 73 63 | 72 69 70 74 2c 20 70 65 | your sc|ript, pe|
|00000fd0| 72 6c 20 63 6f 6d 70 69 | 6c 65 73 20 69 74 20 74 |rl compi|les it t|
|00000fe0| 6f 20 61 6e 20 69 6e 74 | 65 72 6e 61 6c 20 66 6f |o an int|ernal fo|
|00000ff0| 72 6d 2e 0d 49 66 20 74 | 68 65 20 73 63 72 69 70 |rm..If t|he scrip|
|00001000| 74 20 69 73 20 73 79 6e | 74 61 63 74 69 63 61 6c |t is syn|tactical|
|00001010| 6c 79 20 63 6f 72 72 65 | 63 74 2c 20 69 74 20 69 |ly corre|ct, it i|
|00001020| 73 20 65 78 65 63 75 74 | 65 64 2e 0d 0d be 4b 59 |s execut|ed....KY|
|00001030| 20 50 65 72 6c c9 4f 70 | 74 69 6f 6e 73 0d be 43 | Perl.Op|tions..C|
|00001040| 20 41 20 73 69 6e 67 6c | 65 2d 63 68 61 72 61 63 | A singl|e-charac|
|00001050| 74 65 72 20 6f 70 74 69 | 6f 6e 20 6d 61 79 20 62 |ter opti|on may b|
|00001060| 65 20 63 6f 6d 62 69 6e | 65 64 20 77 69 74 68 20 |e combin|ed with |
|00001070| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 0d 6f 70 |the foll|owing.op|
|00001080| 74 69 6f 6e 2c 20 69 66 | 20 61 6e 79 2e 20 20 54 |tion, if| any. T|
|00001090| 68 69 73 20 69 73 20 70 | 61 72 74 69 63 75 6c 61 |his is p|articula|
|000010a0| 72 6c 79 20 75 73 65 66 | 75 6c 20 77 68 65 6e 20 |rly usef|ul when |
|000010b0| 69 6e 76 6f 6b 69 6e 67 | 20 61 0d 73 63 72 69 70 |invoking| a.scrip|
|000010c0| 74 20 75 73 69 6e 67 20 | 74 68 65 20 23 21 20 63 |t using |the #! c|
|000010d0| 6f 6e 73 74 72 75 63 74 | 20 77 68 69 63 68 20 6f |onstruct| which o|
|000010e0| 6e 6c 79 20 61 6c 6c 6f | 77 73 20 6f 6e 65 20 61 |nly allo|ws one a|
|000010f0| 72 67 75 6d 65 6e 74 2e | 0d 45 78 61 6d 70 6c 65 |rgument.|.Example|
|00001100| 3a 0d 0d 20 20 20 20 20 | 23 21 2f 75 73 72 2f 62 |:.. |#!/usr/b|
|00001110| 69 6e 2f 70 65 72 6c 20 | 2d 73 70 69 2e 62 61 6b |in/perl |-spi.bak|
|00001120| 20 23 20 73 61 6d 65 20 | 61 73 20 2d 73 20 2d 70 | # same |as -s -p|
|00001130| 20 2d 69 2e 62 61 6b 0d | 20 20 20 20 20 2e 2e 2e | -i.bak.| ...|
|00001140| 0d 0d 4f 70 74 69 6f 6e | 73 20 69 6e 63 6c 75 64 |..Option|s includ|
|00001150| 65 3a 0d 0d 2d 30 64 69 | 67 69 74 73 0d 20 20 20 |e:..-0di|gits. |
|00001160| 20 20 73 70 65 63 69 66 | 69 65 73 20 74 68 65 20 | specif|ies the |
|00001170| 72 65 63 6f 72 64 20 73 | 65 70 61 72 61 74 6f 72 |record s|eparator|
|00001180| 20 28 24 2f 29 20 61 73 | 20 61 6e 20 6f 63 74 61 | ($/) as| an octa|
|00001190| 6c 20 6e 75 6d 62 65 72 | 2e 20 20 49 66 0d 20 20 |l number|. If. |
|000011a0| 20 20 20 74 68 65 72 65 | 20 61 72 65 20 6e 6f 20 | there| are no |
|000011b0| 64 69 67 69 74 73 2c 20 | 74 68 65 20 6e 75 6c 6c |digits, |the null|
|000011c0| 20 63 68 61 72 61 63 74 | 65 72 20 69 73 20 74 68 | charact|er is th|
|000011d0| 65 20 73 65 70 61 72 61 | 74 6f 72 2e 0d 20 20 20 |e separa|tor.. |
|000011e0| 20 20 4f 74 68 65 72 20 | 73 77 69 74 63 68 65 73 | Other |switches|
|000011f0| 20 6d 61 79 20 70 72 65 | 63 65 64 65 20 6f 72 20 | may pre|cede or |
|00001200| 66 6f 6c 6c 6f 77 20 74 | 68 65 20 64 69 67 69 74 |follow t|he digit|
|00001210| 73 2e 20 20 46 6f 72 20 | 65 78 61 6d 2d 0d 20 20 |s. For |exam-. |
|00001220| 20 20 20 70 6c 65 2c 20 | 69 66 20 79 6f 75 20 68 | ple, |if you h|
|00001230| 61 76 65 20 61 20 76 65 | 72 73 69 6f 6e 20 6f 66 |ave a ve|rsion of|
|00001240| 20 66 69 6e 64 20 77 68 | 69 63 68 20 63 61 6e 20 | find wh|ich can |
|00001250| 70 72 69 6e 74 20 66 69 | 6c 65 6e 61 6d 65 73 0d |print fi|lenames.|
|00001260| 20 20 20 20 20 74 65 72 | 6d 69 6e 61 74 65 64 20 | ter|minated |
|00001270| 62 79 20 74 68 65 20 6e | 75 6c 6c 20 63 68 61 72 |by the n|ull char|
|00001280| 61 63 74 65 72 2c 20 79 | 6f 75 20 63 61 6e 20 73 |acter, y|ou can s|
|00001290| 61 79 20 74 68 69 73 3a | 0d 0d 20 20 20 20 20 20 |ay this:|.. |
|000012a0| 20 20 20 20 20 20 20 20 | 20 66 69 6e 64 20 2e 20 | | find . |
|000012b0| 2d 6e 61 6d 65 20 27 2a | 2e 62 61 6b 27 20 2d 70 |-name '*|.bak' -p|
|000012c0| 72 69 6e 74 30 20 7c 20 | 70 65 72 6c 20 2d 6e 30 |rint0 | |perl -n0|
|000012d0| 65 20 75 6e 6c 69 6e 6b | 0d 0d 20 20 20 20 20 54 |e unlink|.. T|
|000012e0| 68 65 20 73 70 65 63 69 | 61 6c 20 76 61 6c 75 65 |he speci|al value|
|000012f0| 20 30 30 20 77 69 6c 6c | 20 63 61 75 73 65 20 50 | 00 will| cause P|
|00001300| 65 72 6c 20 74 6f 20 73 | 6c 75 72 70 20 66 69 6c |erl to s|lurp fil|
|00001310| 65 73 20 69 6e 20 70 61 | 72 61 2d 0d 20 20 20 20 |es in pa|ra-. |
|00001320| 20 67 72 61 70 68 20 6d | 6f 64 65 2e 20 20 54 68 | graph m|ode. Th|
|00001330| 65 20 76 61 6c 75 65 20 | 30 37 37 37 20 77 69 6c |e value |0777 wil|
|00001340| 6c 20 63 61 75 73 65 20 | 50 65 72 6c 20 74 6f 20 |l cause |Perl to |
|00001350| 73 6c 75 72 70 20 66 69 | 6c 65 73 0d 20 20 20 20 |slurp fi|les. |
|00001360| 20 77 68 6f 6c 65 20 73 | 69 6e 63 65 20 74 68 65 | whole s|ince the|
|00001370| 72 65 20 69 73 20 6e 6f | 20 6c 65 67 61 6c 20 63 |re is no| legal c|
|00001380| 68 61 72 61 63 74 65 72 | 20 77 69 74 68 20 74 68 |haracter| with th|
|00001390| 61 74 20 76 61 6c 75 65 | 2e 0d 0d 2d 61 20 20 20 |at value|...-a |
|000013a0| 74 75 72 6e 73 20 6f 6e | 20 61 75 74 6f 73 70 6c |turns on| autospl|
|000013b0| 69 74 20 6d 6f 64 65 20 | 77 68 65 6e 20 75 73 65 |it mode |when use|
|000013c0| 64 20 77 69 74 68 20 61 | 20 2d 6e 20 6f 72 20 2d |d with a| -n or -|
|000013d0| 70 2e 20 20 41 6e 0d 20 | 20 20 20 20 69 6d 70 6c |p. An. | impl|
|000013e0| 69 63 69 74 20 73 70 6c | 69 74 20 63 6f 6d 6d 61 |icit spl|it comma|
|000013f0| 6e 64 20 74 6f 20 74 68 | 65 20 40 46 20 61 72 72 |nd to th|e @F arr|
|00001400| 61 79 20 69 73 20 64 6f | 6e 65 20 61 73 20 74 68 |ay is do|ne as th|
|00001410| 65 20 66 69 72 73 74 0d | 20 20 20 20 20 74 68 69 |e first.| thi|
|00001420| 6e 67 20 69 6e 73 69 64 | 65 20 74 68 65 20 69 6d |ng insid|e the im|
|00001430| 70 6c 69 63 69 74 20 77 | 68 69 6c 65 20 6c 6f 6f |plicit w|hile loo|
|00001440| 70 20 70 72 6f 64 75 63 | 65 64 20 62 79 20 74 68 |p produc|ed by th|
|00001450| 65 20 2d 6e 20 6f 72 20 | 2d 70 2e 0d 0d 20 20 20 |e -n or |-p... |
|00001460| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001470| 20 70 65 72 6c 20 2d 61 | 6e 65 20 27 70 72 69 6e | perl -a|ne 'prin|
|00001480| 74 20 70 6f 70 28 40 46 | 29 2c 20 22 5c 6e 22 3b |t pop(@F|), "\n";|
|00001490| 27 0d 0d 20 20 20 20 20 | 69 73 20 65 71 75 69 76 |'.. |is equiv|
|000014a0| 61 6c 65 6e 74 20 74 6f | 0d 0d 20 20 20 20 20 20 |alent to|.. |
|000014b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 77 68 | | wh|
|000014c0| 69 6c 65 20 28 3c 3e 29 | 20 7b 0d 20 20 20 20 20 |ile (<>)| {. |
|000014d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000014e0| 20 20 20 20 40 46 20 3d | 20 73 70 6c 69 74 28 27 | @F =| split('|
|000014f0| 20 27 29 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 | ');. | |
|00001500| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 70 72 | | pr|
|00001510| 69 6e 74 20 70 6f 70 28 | 40 46 29 2c 20 22 5c 6e |int pop(|@F), "\n|
|00001520| 22 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |";. | |
|00001530| 20 20 20 20 20 20 20 7d | 0d 0d 0d 2d 63 20 20 20 | }|...-c |
|00001540| 63 61 75 73 65 73 20 70 | 65 72 6c 20 74 6f 20 63 |causes p|erl to c|
|00001550| 68 65 63 6b 20 74 68 65 | 20 73 79 6e 74 61 78 20 |heck the| syntax |
|00001560| 6f 66 20 74 68 65 20 73 | 63 72 69 70 74 20 61 6e |of the s|cript an|
|00001570| 64 20 74 68 65 6e 20 65 | 78 69 74 0d 20 20 20 20 |d then e|xit. |
|00001580| 20 77 69 74 68 6f 75 74 | 20 65 78 65 63 75 74 69 | without| executi|
|00001590| 6e 67 20 69 74 2e 0d 0d | 2d 64 20 20 20 72 75 6e |ng it...|-d run|
|000015a0| 73 20 74 68 65 20 73 63 | 72 69 70 74 20 75 6e 64 |s the sc|ript und|
|000015b0| 65 72 20 74 68 65 20 70 | 65 72 6c 20 64 65 62 75 |er the p|erl debu|
|000015c0| 67 67 65 72 2e 20 20 53 | 65 65 20 74 68 65 20 73 |gger. S|ee the s|
|000015d0| 65 63 74 69 6f 6e 20 6f | 6e 0d 20 20 20 20 20 44 |ection o|n. D|
|000015e0| 65 62 75 67 67 69 6e 67 | 2e 0d 0d 2d 44 6e 75 6d |ebugging|...-Dnum|
|000015f0| 62 65 72 0d 20 20 20 20 | 20 73 65 74 73 20 64 65 |ber. | sets de|
|00001600| 62 75 67 67 69 6e 67 20 | 66 6c 61 67 73 2e 20 20 |bugging |flags. |
|00001610| 54 6f 20 77 61 74 63 68 | 20 68 6f 77 20 69 74 20 |To watch| how it |
|00001620| 65 78 65 63 75 74 65 73 | 20 79 6f 75 72 20 73 63 |executes| your sc|
|00001630| 72 69 70 74 2c 0d 20 20 | 20 20 20 75 73 65 20 2d |ript,. | use -|
|00001640| 44 31 34 2e 20 20 28 54 | 68 69 73 20 6f 6e 6c 79 |D14. (T|his only|
|00001650| 20 77 6f 72 6b 73 20 69 | 66 20 64 65 62 75 67 67 | works i|f debugg|
|00001660| 69 6e 67 20 69 73 20 63 | 6f 6d 70 69 6c 65 64 20 |ing is c|ompiled |
|00001670| 69 6e 74 6f 0d 20 20 20 | 20 20 79 6f 75 72 20 70 |into. | your p|
|00001680| 65 72 6c 2e 29 20 41 6e | 6f 74 68 65 72 20 6e 69 |erl.) An|other ni|
|00001690| 63 65 20 76 61 6c 75 65 | 20 69 73 20 2d 44 31 30 |ce value| is -D10|
|000016a0| 32 34 2c 20 77 68 69 63 | 68 20 6c 69 73 74 73 20 |24, whic|h lists |
|000016b0| 79 6f 75 72 0d 20 20 20 | 20 20 63 6f 6d 70 69 6c |your. | compil|
|000016c0| 65 64 20 73 79 6e 74 61 | 78 20 74 72 65 65 2e 20 |ed synta|x tree. |
|000016d0| 20 41 6e 64 20 2d 44 35 | 31 32 20 64 69 73 70 6c | And -D5|12 displ|
|000016e0| 61 79 73 20 63 6f 6d 70 | 69 6c 65 64 20 72 65 67 |ays comp|iled reg|
|000016f0| 75 6c 61 72 0d 20 20 20 | 20 20 65 78 70 72 65 73 |ular. | expres|
|00001700| 73 69 6f 6e 73 2e 0d 0d | 2d 65 20 63 6f 6d 6d 61 |sions...|-e comma|
|00001710| 6e 64 6c 69 6e 65 0d 20 | 20 20 20 20 6d 61 79 20 |ndline. | may |
|00001720| 62 65 20 75 73 65 64 20 | 74 6f 20 65 6e 74 65 72 |be used |to enter|
|00001730| 20 6f 6e 65 20 6c 69 6e | 65 20 6f 66 20 73 63 72 | one lin|e of scr|
|00001740| 69 70 74 2e 20 20 4d 75 | 6c 74 69 70 6c 65 20 2d |ipt. Mu|ltiple -|
|00001750| 65 20 63 6f 6d 2d 0d 20 | 20 20 20 20 6d 61 6e 64 |e com-. | mand|
|00001760| 73 20 6d 61 79 20 62 65 | 20 67 69 76 65 6e 20 74 |s may be| given t|
|00001770| 6f 20 62 75 69 6c 64 20 | 75 70 20 61 20 6d 75 6c |o build |up a mul|
|00001780| 74 69 2d 6c 69 6e 65 20 | 73 63 72 69 70 74 2e 20 |ti-line |script. |
|00001790| 20 49 66 20 2d 65 0d 20 | 20 20 20 20 69 73 20 67 | If -e. | is g|
|000017a0| 69 76 65 6e 2c 20 70 65 | 72 6c 20 77 69 6c 6c 20 |iven, pe|rl will |
|000017b0| 6e 6f 74 20 6c 6f 6f 6b | 20 66 6f 72 20 61 20 73 |not look| for a s|
|000017c0| 63 72 69 70 74 20 66 69 | 6c 65 6e 61 6d 65 20 69 |cript fi|lename i|
|000017d0| 6e 20 74 68 65 0d 20 20 | 20 20 20 61 72 67 75 6d |n the. | argum|
|000017e0| 65 6e 74 20 6c 69 73 74 | 2e 0d 0d 2d 69 65 78 74 |ent list|...-iext|
|000017f0| 65 6e 73 69 6f 6e 0d 20 | 20 20 20 20 73 70 65 63 |ension. | spec|
|00001800| 69 66 69 65 73 20 74 68 | 61 74 20 66 69 6c 65 73 |ifies th|at files|
|00001810| 20 70 72 6f 63 65 73 73 | 65 64 20 62 79 20 74 68 | process|ed by th|
|00001820| 65 20 3c 3e 20 63 6f 6e | 73 74 72 75 63 74 20 61 |e <> con|struct a|
|00001830| 72 65 20 74 6f 20 62 65 | 0d 20 20 20 20 20 65 64 |re to be|. ed|
|00001840| 69 74 65 64 20 69 6e 2d | 70 6c 61 63 65 2e 20 20 |ited in-|place. |
|00001850| 49 74 20 64 6f 65 73 20 | 74 68 69 73 20 62 79 20 |It does |this by |
|00001860| 72 65 6e 61 6d 69 6e 67 | 20 74 68 65 20 69 6e 70 |renaming| the inp|
|00001870| 75 74 20 66 69 6c 65 2c | 0d 20 20 20 20 20 6f 70 |ut file,|. op|
|00001880| 65 6e 69 6e 67 20 74 68 | 65 20 6f 75 74 70 75 74 |ening th|e output|
|00001890| 20 66 69 6c 65 20 62 79 | 20 74 68 65 20 73 61 6d | file by| the sam|
|000018a0| 65 20 6e 61 6d 65 2c 20 | 61 6e 64 20 73 65 6c 65 |e name, |and sele|
|000018b0| 63 74 69 6e 67 20 74 68 | 61 74 0d 20 20 20 20 20 |cting th|at. |
|000018c0| 6f 75 74 70 75 74 20 66 | 69 6c 65 20 61 73 20 74 |output f|ile as t|
|000018d0| 68 65 20 64 65 66 61 75 | 6c 74 20 66 6f 72 20 70 |he defau|lt for p|
|000018e0| 72 69 6e 74 20 73 74 61 | 74 65 6d 65 6e 74 73 2e |rint sta|tements.|
|000018f0| 20 20 54 68 65 20 65 78 | 74 65 6e 2d 0d 20 20 20 | The ex|ten-. |
|00001900| 20 20 73 69 6f 6e 2c 20 | 69 66 20 73 75 70 70 6c | sion, |if suppl|
|00001910| 69 65 64 2c 20 69 73 20 | 61 64 64 65 64 20 74 6f |ied, is |added to|
|00001920| 20 74 68 65 20 6e 61 6d | 65 20 6f 66 20 74 68 65 | the nam|e of the|
|00001930| 20 6f 6c 64 20 66 69 6c | 65 20 74 6f 0d 20 20 20 | old fil|e to. |
|00001940| 20 20 6d 61 6b 65 20 61 | 20 62 61 63 6b 75 70 20 | make a| backup |
|00001950| 63 6f 70 79 2e 20 20 49 | 66 20 6e 6f 20 65 78 74 |copy. I|f no ext|
|00001960| 65 6e 73 69 6f 6e 20 69 | 73 20 73 75 70 70 6c 69 |ension i|s suppli|
|00001970| 65 64 2c 20 6e 6f 20 62 | 61 63 6b 75 70 0d 20 20 |ed, no b|ackup. |
|00001980| 20 20 20 69 73 20 6d 61 | 64 65 2e 20 20 53 61 79 | is ma|de. Say|
|00001990| 69 6e 67 20 22 70 65 72 | 6c 20 2d 70 20 2d 69 2e |ing "per|l -p -i.|
|000019a0| 62 61 6b 20 2d 65 20 22 | 73 2f 66 6f 6f 2f 62 61 |bak -e "|s/foo/ba|
|000019b0| 72 2f 3b 22 20 2e 2e 2e | 20 22 20 69 73 0d 20 20 |r/;" ...| " is. |
|000019c0| 20 20 20 74 68 65 20 73 | 61 6d 65 20 61 73 20 75 | the s|ame as u|
|000019d0| 73 69 6e 67 20 74 68 65 | 20 73 63 72 69 70 74 3a |sing the| script:|
|000019e0| 0d 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|000019f0| 20 20 20 20 20 20 23 21 | 2f 75 73 72 2f 62 69 6e | #!|/usr/bin|
|00001a00| 2f 70 65 72 6c 20 2d 70 | 69 2e 62 61 6b 0d 20 20 |/perl -p|i.bak. |
|00001a10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001a20| 20 20 73 2f 66 6f 6f 2f | 62 61 72 2f 3b 0d 0d 20 | s/foo/|bar/;.. |
|00001a30| 20 20 20 20 77 68 69 63 | 68 20 69 73 20 65 71 75 | whic|h is equ|
|00001a40| 69 76 61 6c 65 6e 74 20 | 74 6f 0d 0d 20 20 20 20 |ivalent |to.. |
|00001a50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001a60| 23 21 2f 75 73 72 2f 62 | 69 6e 2f 70 65 72 6c 0d |#!/usr/b|in/perl.|
|00001a70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001a80| 20 20 20 20 77 68 69 6c | 65 20 28 3c 3e 29 20 7b | whil|e (<>) {|
|00001a90| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00001aa0| 20 20 20 20 20 20 20 20 | 20 20 69 66 20 28 24 41 | | if ($A|
|00001ab0| 52 47 56 20 6e 65 20 24 | 6f 6c 64 61 72 67 76 29 |RGV ne $|oldargv)|
|00001ac0| 20 7b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | {. | |
|00001ad0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001ae0| 20 72 65 6e 61 6d 65 28 | 24 41 52 47 56 2c 20 24 | rename(|$ARGV, $|
|00001af0| 41 52 47 56 20 2e 20 27 | 2e 62 61 6b 27 29 3b 0d |ARGV . '|.bak');.|
|00001b00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001b10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 6f 70 | | op|
|00001b20| 65 6e 28 41 52 47 56 4f | 55 54 2c 20 22 3e 24 41 |en(ARGVO|UT, ">$A|
|00001b30| 52 47 56 22 29 3b 0d 20 | 20 20 20 20 20 20 20 20 |RGV");. | |
|00001b40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001b50| 20 20 20 20 20 73 65 6c | 65 63 74 28 41 52 47 56 | sel|ect(ARGV|
|00001b60| 4f 55 54 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |OUT);. | |
|00001b70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001b80| 20 20 20 20 24 6f 6c 64 | 61 72 67 76 20 3d 20 24 | $old|argv = $|
|00001b90| 41 52 47 56 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |ARGV;. | |
|00001ba0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 7d | | }|
|00001bb0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00001bc0| 20 20 20 20 20 20 20 20 | 20 20 73 2f 66 6f 6f 2f | | s/foo/|
|00001bd0| 62 61 72 2f 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |bar/;. | |
|00001be0| 20 20 20 20 20 20 20 20 | 20 20 7d 0d 20 20 20 20 | | }. |
|00001bf0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001c00| 63 6f 6e 74 69 6e 75 65 | 20 7b 0d 20 20 20 20 20 |continue| {. |
|00001c10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001c20| 70 72 69 6e 74 3b 20 20 | 20 20 20 23 20 74 68 69 |print; | # thi|
|00001c30| 73 20 70 72 69 6e 74 73 | 20 74 6f 20 6f 72 69 67 |s prints| to orig|
|00001c40| 69 6e 61 6c 20 66 69 6c | 65 6e 61 6d 65 0d 20 20 |inal fil|ename. |
|00001c50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001c60| 20 20 7d 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 | }. | |
|00001c70| 20 20 20 20 20 20 20 20 | 73 65 6c 65 63 74 28 53 | |select(S|
|00001c80| 54 44 4f 55 54 29 3b 0d | 0d 20 20 20 20 20 65 78 |TDOUT);.|. ex|
|00001c90| 63 65 70 74 20 74 68 61 | 74 20 74 68 65 20 2d 69 |cept tha|t the -i|
|00001ca0| 20 66 6f 72 6d 20 64 6f | 65 73 6e 27 74 20 6e 65 | form do|esn't ne|
|00001cb0| 65 64 20 74 6f 20 63 6f | 6d 70 61 72 65 20 24 41 |ed to co|mpare $A|
|00001cc0| 52 47 56 20 74 6f 0d 20 | 20 20 20 20 24 6f 6c 64 |RGV to. | $old|
|00001cd0| 61 72 67 76 20 74 6f 20 | 6b 6e 6f 77 20 77 68 65 |argv to |know whe|
|00001ce0| 6e 20 74 68 65 20 66 69 | 6c 65 6e 61 6d 65 20 68 |n the fi|lename h|
|00001cf0| 61 73 20 63 68 61 6e 67 | 65 64 2e 20 20 49 74 20 |as chang|ed. It |
|00001d00| 64 6f 65 73 2c 0d 20 20 | 20 20 20 68 6f 77 65 76 |does,. | howev|
|00001d10| 65 72 2c 20 75 73 65 20 | 41 52 47 56 4f 55 54 20 |er, use |ARGVOUT |
|00001d20| 66 6f 72 20 74 68 65 20 | 73 65 6c 65 63 74 65 64 |for the |selected|
|00001d30| 20 66 69 6c 65 68 61 6e | 64 6c 65 2e 20 20 4e 6f | filehan|dle. No|
|00001d40| 74 65 20 74 68 61 74 0d | 20 20 20 20 20 53 54 44 |te that.| STD|
|00001d50| 4f 55 54 20 69 73 20 72 | 65 73 74 6f 72 65 64 20 |OUT is r|estored |
|00001d60| 61 73 20 74 68 65 20 64 | 65 66 61 75 6c 74 20 6f |as the d|efault o|
|00001d70| 75 74 70 75 74 20 66 69 | 6c 65 68 61 6e 64 6c 65 |utput fi|lehandle|
|00001d80| 20 61 66 74 65 72 0d 20 | 20 20 20 20 74 68 65 20 | after. | the |
|00001d90| 6c 6f 6f 70 2e 0d 0d 20 | 20 20 20 20 59 6f 75 20 |loop... | You |
|00001da0| 63 61 6e 20 75 73 65 20 | 65 6f 66 20 74 6f 20 6c |can use |eof to l|
|00001db0| 6f 63 61 74 65 20 74 68 | 65 20 65 6e 64 20 6f 66 |ocate th|e end of|
|00001dc0| 20 65 61 63 68 20 69 6e | 70 75 74 20 66 69 6c 65 | each in|put file|
|00001dd0| 2c 20 69 6e 0d 20 20 20 | 20 20 63 61 73 65 20 79 |, in. | case y|
|00001de0| 6f 75 20 77 61 6e 74 20 | 74 6f 20 61 70 70 65 6e |ou want |to appen|
|00001df0| 64 20 74 6f 20 65 61 63 | 68 20 66 69 6c 65 2c 20 |d to eac|h file, |
|00001e00| 6f 72 20 72 65 73 65 74 | 20 6c 69 6e 65 20 6e 75 |or reset| line nu|
|00001e10| 6d 62 65 72 2d 0d 20 20 | 20 20 20 69 6e 67 20 28 |mber-. | ing (|
|00001e20| 73 65 65 20 65 78 61 6d | 70 6c 65 20 75 6e 64 65 |see exam|ple unde|
|00001e30| 72 20 65 6f 66 29 2e 0d | 0d 2d 49 64 69 72 65 63 |r eof)..|.-Idirec|
|00001e40| 74 6f 72 79 0d 20 20 20 | 20 20 6d 61 79 20 62 65 |tory. | may be|
|00001e50| 20 75 73 65 64 20 69 6e | 20 63 6f 6e 6a 75 6e 63 | used in| conjunc|
|00001e60| 74 69 6f 6e 20 77 69 74 | 68 20 2d 50 20 74 6f 20 |tion wit|h -P to |
|00001e70| 74 65 6c 6c 20 74 68 65 | 20 43 20 70 72 65 70 72 |tell the| C prepr|
|00001e80| 6f 63 65 73 2d 0d 20 20 | 20 20 20 73 6f 72 20 77 |oces-. | sor w|
|00001e90| 68 65 72 65 20 74 6f 20 | 6c 6f 6f 6b 20 66 6f 72 |here to |look for|
|00001ea0| 20 69 6e 63 6c 75 64 65 | 20 66 69 6c 65 73 2e 20 | include| files. |
|00001eb0| 20 42 79 20 64 65 66 61 | 75 6c 74 0d 20 20 20 20 | By defa|ult. |
|00001ec0| 20 2f 75 73 72 2f 69 6e | 63 6c 75 64 65 20 61 6e | /usr/in|clude an|
|00001ed0| 64 20 2f 75 73 72 2f 6c | 69 62 2f 70 65 72 6c 20 |d /usr/l|ib/perl |
|00001ee0| 61 72 65 20 73 65 61 72 | 63 68 65 64 2e 0d 0d 2d |are sear|ched...-|
|00001ef0| 6c 6f 63 74 6e 75 6d 0d | 20 20 20 20 20 65 6e 61 |loctnum.| ena|
|00001f00| 62 6c 65 73 20 61 75 74 | 6f 6d 61 74 69 63 20 6c |bles aut|omatic l|
|00001f10| 69 6e 65 2d 65 6e 64 69 | 6e 67 20 70 72 6f 63 65 |ine-endi|ng proce|
|00001f20| 73 73 69 6e 67 2e 20 20 | 49 74 20 68 61 73 20 74 |ssing. |It has t|
|00001f30| 77 6f 0d 20 20 20 20 20 | 65 66 66 65 63 74 73 3a |wo. |effects:|
|00001f40| 20 66 69 72 73 74 2c 20 | 69 74 20 61 75 74 6f 6d | first, |it autom|
|00001f50| 61 74 69 63 61 6c 6c 79 | 20 63 68 6f 70 73 20 74 |atically| chops t|
|00001f60| 68 65 20 6c 69 6e 65 20 | 74 65 72 6d 69 6e 61 74 |he line |terminat|
|00001f70| 6f 72 0d 20 20 20 20 20 | 77 68 65 6e 20 75 73 65 |or. |when use|
|00001f80| 64 20 77 69 74 68 20 2d | 6e 20 6f 72 20 2d 70 20 |d with -|n or -p |
|00001f90| 2c 20 61 6e 64 20 73 65 | 63 6f 6e 64 2c 20 69 74 |, and se|cond, it|
|00001fa0| 20 61 73 73 69 67 6e 73 | 20 24 5c 20 74 6f 20 68 | assigns| $\ to h|
|00001fb0| 61 76 65 0d 20 20 20 20 | 20 74 68 65 20 76 61 6c |ave. | the val|
|00001fc0| 75 65 20 6f 66 20 6f 63 | 74 6e 75 6d 20 73 6f 20 |ue of oc|tnum so |
|00001fd0| 74 68 61 74 20 61 6e 79 | 20 70 72 69 6e 74 20 73 |that any| print s|
|00001fe0| 74 61 74 65 6d 65 6e 74 | 73 20 77 69 6c 6c 20 68 |tatement|s will h|
|00001ff0| 61 76 65 0d 20 20 20 20 | 20 74 68 61 74 20 6c 69 |ave. | that li|
|00002000| 6e 65 20 74 65 72 6d 69 | 6e 61 74 6f 72 20 61 64 |ne termi|nator ad|
|00002010| 64 65 64 20 62 61 63 6b | 20 6f 6e 2e 20 20 49 66 |ded back| on. If|
|00002020| 20 6f 63 74 6e 75 6d 20 | 69 73 20 6f 6d 69 74 74 | octnum |is omitt|
|00002030| 65 64 2c 0d 20 20 20 20 | 20 73 65 74 73 20 24 5c |ed,. | sets $\|
|00002040| 20 74 6f 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | to the |current |
|00002050| 76 61 6c 75 65 20 6f 66 | 20 24 2f 2e 20 20 46 6f |value of| $/. Fo|
|00002060| 72 20 69 6e 73 74 61 6e | 63 65 2c 20 74 6f 20 74 |r instan|ce, to t|
|00002070| 72 69 6d 0d 20 20 20 20 | 20 6c 69 6e 65 73 20 74 |rim. | lines t|
|00002080| 6f 20 38 30 20 63 6f 6c | 75 6d 6e 73 3a 0d 0d 20 |o 80 col|umns:.. |
|00002090| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000020a0| 20 20 20 70 65 72 6c 20 | 2d 6c 70 65 20 27 73 75 | perl |-lpe 'su|
|000020b0| 62 73 74 72 28 24 5f 2c | 20 38 30 29 20 3d 20 22 |bstr($_,| 80) = "|
|000020c0| 22 27 0d 0d 20 20 20 20 | 20 4e 6f 74 65 20 74 68 |"'.. | Note th|
|000020d0| 61 74 20 74 68 65 20 61 | 73 73 69 67 6e 6d 65 6e |at the a|ssignmen|
|000020e0| 74 20 24 5c 20 3d 20 24 | 2f 20 69 73 20 64 6f 6e |t $\ = $|/ is don|
|000020f0| 65 20 77 68 65 6e 20 74 | 68 65 20 73 77 69 74 63 |e when t|he switc|
|00002100| 68 20 69 73 0d 20 20 20 | 20 20 70 72 6f 63 65 73 |h is. | proces|
|00002110| 73 65 64 2c 20 73 6f 20 | 74 68 65 20 69 6e 70 75 |sed, so |the inpu|
|00002120| 74 20 72 65 63 6f 72 64 | 20 73 65 70 61 72 61 74 |t record| separat|
|00002130| 6f 72 20 63 61 6e 20 62 | 65 20 64 69 66 66 65 72 |or can b|e differ|
|00002140| 65 6e 74 0d 20 20 20 20 | 20 74 68 61 6e 20 74 68 |ent. | than th|
|00002150| 65 20 6f 75 74 70 75 74 | 20 72 65 63 6f 72 64 20 |e output| record |
|00002160| 73 65 70 61 72 61 74 6f | 72 20 69 66 20 74 68 65 |separato|r if the|
|00002170| 20 2d 6c 20 73 77 69 74 | 63 68 20 69 73 20 66 6f | -l swit|ch is fo|
|00002180| 6c 2d 0d 20 20 20 20 20 | 6c 6f 77 65 64 20 62 79 |l-. |lowed by|
|00002190| 20 61 20 2d 30 20 73 77 | 69 74 63 68 3a 0d 0d 20 | a -0 sw|itch:.. |
|000021a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000021b0| 20 20 20 67 6e 75 66 69 | 6e 64 20 2f 20 2d 70 72 | gnufi|nd / -pr|
|000021c0| 69 6e 74 30 20 7c 20 70 | 65 72 6c 20 2d 6c 6e 30 |int0 | p|erl -ln0|
|000021d0| 65 20 27 70 72 69 6e 74 | 20 22 66 6f 75 6e 64 20 |e 'print| "found |
|000021e0| 24 5f 22 20 69 66 20 2d | 70 27 0d 0d 20 20 20 20 |$_" if -|p'.. |
|000021f0| 20 54 68 69 73 20 73 65 | 74 73 20 24 5c 20 74 6f | This se|ts $\ to|
|00002200| 20 6e 65 77 6c 69 6e 65 | 20 61 6e 64 20 74 68 65 | newline| and the|
|00002210| 6e 20 73 65 74 73 20 24 | 2f 20 74 6f 20 74 68 65 |n sets $|/ to the|
|00002220| 20 6e 75 6c 6c 20 63 68 | 61 72 61 63 2d 0d 20 20 | null ch|arac-. |
|00002230| 20 20 20 74 65 72 2e 0d | 0d 2d 6e 20 20 20 63 61 | ter..|.-n ca|
|00002240| 75 73 65 73 20 70 65 72 | 6c 20 74 6f 20 61 73 73 |uses per|l to ass|
|00002250| 75 6d 65 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |ume the |followin|
|00002260| 67 20 6c 6f 6f 70 20 61 | 72 6f 75 6e 64 20 79 6f |g loop a|round yo|
|00002270| 75 72 20 73 63 72 69 70 | 74 2c 0d 20 20 20 20 20 |ur scrip|t,. |
|00002280| 77 68 69 63 68 20 6d 61 | 6b 65 73 20 69 74 20 69 |which ma|kes it i|
|00002290| 74 65 72 61 74 65 20 6f | 76 65 72 20 66 69 6c 65 |terate o|ver file|
|000022a0| 6e 61 6d 65 20 61 72 67 | 75 6d 65 6e 74 73 20 73 |name arg|uments s|
|000022b0| 6f 6d 65 77 68 61 74 20 | 6c 69 6b 65 0d 20 20 20 |omewhat |like. |
|000022c0| 20 20 22 73 65 64 20 2d | 6e 22 20 6f 72 20 61 77 | "sed -|n" or aw|
|000022d0| 6b 3a 0d 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |k:.. | |
|000022e0| 20 20 20 20 20 20 20 20 | 77 68 69 6c 65 20 28 3c | |while (<|
|000022f0| 3e 29 20 7b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |>) {. | |
|00002300| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2e 2e | | ..|
|00002310| 2e 20 20 20 20 20 20 20 | 23 20 79 6f 75 72 20 73 |. |# your s|
|00002320| 63 72 69 70 74 20 67 6f | 65 73 20 68 65 72 65 0d |cript go|es here.|
|00002330| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002340| 20 20 20 20 7d 0d 0d 20 | 20 20 20 20 4e 6f 74 65 | }.. | Note|
|00002350| 20 74 68 61 74 20 74 68 | 65 20 6c 69 6e 65 73 20 | that th|e lines |
|00002360| 61 72 65 20 6e 6f 74 20 | 70 72 69 6e 74 65 64 20 |are not |printed |
|00002370| 62 79 20 64 65 66 61 75 | 6c 74 2e 20 20 53 65 65 |by defau|lt. See|
|00002380| 20 2d 70 20 74 6f 0d 20 | 20 20 20 20 68 61 76 65 | -p to. | have|
|00002390| 20 6c 69 6e 65 73 20 70 | 72 69 6e 74 65 64 2e 20 | lines p|rinted. |
|000023a0| 20 48 65 72 65 20 69 73 | 20 61 6e 20 65 66 66 69 | Here is| an effi|
|000023b0| 63 69 65 6e 74 20 77 61 | 79 20 74 6f 20 64 65 6c |cient wa|y to del|
|000023c0| 65 74 65 20 61 6c 6c 0d | 20 20 20 20 20 66 69 6c |ete all.| fil|
|000023d0| 65 73 20 6f 6c 64 65 72 | 20 74 68 61 6e 20 61 20 |es older| than a |
|000023e0| 77 65 65 6b 3a 0d 0d 20 | 20 20 20 20 20 20 20 20 |week:.. | |
|000023f0| 20 20 20 20 20 20 20 20 | 20 20 20 66 69 6e 64 20 | | find |
|00002400| 2e 20 2d 6d 74 69 6d 65 | 20 2b 37 20 2d 70 72 69 |. -mtime| +7 -pri|
|00002410| 6e 74 20 7c 20 70 65 72 | 6c 20 2d 6e 6c 65 20 27 |nt | per|l -nle '|
|00002420| 75 6e 6c 69 6e 6b 3b 27 | 0d 0d 20 20 20 20 20 54 |unlink;'|.. T|
|00002430| 68 69 73 20 69 73 20 66 | 61 73 74 65 72 20 74 68 |his is f|aster th|
|00002440| 61 6e 20 75 73 69 6e 67 | 20 74 68 65 20 2d 65 78 |an using| the -ex|
|00002450| 65 63 20 73 77 69 74 63 | 68 20 6f 66 20 66 69 6e |ec switc|h of fin|
|00002460| 64 20 62 65 63 61 75 73 | 65 0d 20 20 20 20 20 79 |d becaus|e. y|
|00002470| 6f 75 20 64 6f 6e 27 74 | 20 68 61 76 65 20 74 6f |ou don't| have to|
|00002480| 20 73 74 61 72 74 20 61 | 20 70 72 6f 63 65 73 73 | start a| process|
|00002490| 20 6f 6e 20 65 76 65 72 | 79 20 66 69 6c 65 6e 61 | on ever|y filena|
|000024a0| 6d 65 20 66 6f 75 6e 64 | 2e 0d 0d 2d 70 20 20 20 |me found|...-p |
|000024b0| 63 61 75 73 65 73 20 70 | 65 72 6c 20 74 6f 20 61 |causes p|erl to a|
|000024c0| 73 73 75 6d 65 20 74 68 | 65 20 66 6f 6c 6c 6f 77 |ssume th|e follow|
|000024d0| 69 6e 67 20 6c 6f 6f 70 | 20 61 72 6f 75 6e 64 20 |ing loop| around |
|000024e0| 79 6f 75 72 20 73 63 72 | 69 70 74 2c 0d 20 20 20 |your scr|ipt,. |
|000024f0| 20 20 77 68 69 63 68 20 | 6d 61 6b 65 73 20 69 74 | which |makes it|
|00002500| 20 69 74 65 72 61 74 65 | 20 6f 76 65 72 20 66 69 | iterate| over fi|
|00002510| 6c 65 6e 61 6d 65 20 61 | 72 67 75 6d 65 6e 74 73 |lename a|rguments|
|00002520| 20 73 6f 6d 65 77 68 61 | 74 20 6c 69 6b 65 0d 20 | somewha|t like. |
|00002530| 20 20 20 20 73 65 64 3a | 0d 0d 20 20 20 20 20 20 | sed:|.. |
|00002540| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 77 68 | | wh|
|00002550| 69 6c 65 20 28 3c 3e 29 | 20 7b 0d 20 20 20 20 20 |ile (<>)| {. |
|00002560| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002570| 20 20 20 20 2e 2e 2e 20 | 20 20 20 20 20 20 23 20 | ... | # |
|00002580| 79 6f 75 72 20 73 63 72 | 69 70 74 20 67 6f 65 73 |your scr|ipt goes|
|00002590| 20 68 65 72 65 0d 20 20 | 20 20 20 20 20 20 20 20 | here. | |
|000025a0| 20 20 20 20 20 20 20 20 | 20 20 7d 20 63 6f 6e 74 | | } cont|
|000025b0| 69 6e 75 65 20 7b 0d 20 | 20 20 20 20 20 20 20 20 |inue {. | |
|000025c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000025d0| 70 72 69 6e 74 3b 0d 20 | 20 20 20 20 20 20 20 20 |print;. | |
|000025e0| 20 20 20 20 20 20 20 20 | 20 20 20 7d 0d 0d 20 20 | | }.. |
|000025f0| 20 20 20 4e 6f 74 65 20 | 74 68 61 74 20 74 68 65 | Note |that the|
|00002600| 20 6c 69 6e 65 73 20 61 | 72 65 20 70 72 69 6e 74 | lines a|re print|
|00002610| 65 64 20 61 75 74 6f 6d | 61 74 69 63 61 6c 6c 79 |ed autom|atically|
|00002620| 2e 20 20 54 6f 20 73 75 | 70 70 72 65 73 73 0d 20 |. To su|ppress. |
|00002630| 20 20 20 20 70 72 69 6e | 74 69 6e 67 20 75 73 65 | prin|ting use|
|00002640| 20 74 68 65 20 2d 6e 20 | 73 77 69 74 63 68 2e 20 | the -n |switch. |
|00002650| 20 41 20 2d 70 20 6f 76 | 65 72 72 69 64 65 73 20 | A -p ov|errides |
|00002660| 61 20 2d 6e 20 73 77 69 | 74 63 68 2e 0d 0d 2d 50 |a -n swi|tch...-P|
|00002670| 20 20 20 63 61 75 73 65 | 73 20 79 6f 75 72 20 73 | cause|s your s|
|00002680| 63 72 69 70 74 20 74 6f | 20 62 65 20 72 75 6e 20 |cript to| be run |
|00002690| 74 68 72 6f 75 67 68 20 | 74 68 65 20 43 20 70 72 |through |the C pr|
|000026a0| 65 70 72 6f 63 65 73 73 | 6f 72 0d 20 20 20 20 20 |eprocess|or. |
|000026b0| 62 65 66 6f 72 65 20 63 | 6f 6d 70 69 6c 61 74 69 |before c|ompilati|
|000026c0| 6f 6e 20 62 79 20 70 65 | 72 6c 2e 20 20 28 53 69 |on by pe|rl. (Si|
|000026d0| 6e 63 65 20 62 6f 74 68 | 20 63 6f 6d 6d 65 6e 74 |nce both| comment|
|000026e0| 73 20 61 6e 64 20 63 70 | 70 0d 20 20 20 20 20 64 |s and cp|p. d|
|000026f0| 69 72 65 63 74 69 76 65 | 73 20 62 65 67 69 6e 20 |irective|s begin |
|00002700| 77 69 74 68 20 74 68 65 | 20 23 20 63 68 61 72 61 |with the| # chara|
|00002710| 63 74 65 72 2c 20 79 6f | 75 20 73 68 6f 75 6c 64 |cter, yo|u should|
|00002720| 20 61 76 6f 69 64 0d 20 | 20 20 20 20 73 74 61 72 | avoid. | star|
|00002730| 74 69 6e 67 20 63 6f 6d | 6d 65 6e 74 73 20 77 69 |ting com|ments wi|
|00002740| 74 68 20 61 6e 79 20 77 | 6f 72 64 73 20 72 65 63 |th any w|ords rec|
|00002750| 6f 67 6e 69 7a 65 64 20 | 62 79 20 74 68 65 20 43 |ognized |by the C|
|00002760| 20 70 72 65 70 72 6f 2d | 0d 20 20 20 20 20 63 65 | prepro-|. ce|
|00002770| 73 73 6f 72 20 73 75 63 | 68 20 61 73 20 22 69 66 |ssor suc|h as "if|
|00002780| 22 2c 20 22 65 6c 73 65 | 22 20 6f 72 20 22 64 65 |", "else|" or "de|
|00002790| 66 69 6e 65 22 2e 29 0d | 0d 2d 73 20 20 20 65 6e |fine".).|.-s en|
|000027a0| 61 62 6c 65 73 20 73 6f | 6d 65 20 72 75 64 69 6d |ables so|me rudim|
|000027b0| 65 6e 74 61 72 79 20 73 | 77 69 74 63 68 20 70 61 |entary s|witch pa|
|000027c0| 72 73 69 6e 67 20 66 6f | 72 20 73 77 69 74 63 68 |rsing fo|r switch|
|000027d0| 65 73 20 6f 6e 20 74 68 | 65 0d 20 20 20 20 20 63 |es on th|e. c|
|000027e0| 6f 6d 6d 61 6e 64 20 6c | 69 6e 65 20 61 66 74 65 |ommand l|ine afte|
|000027f0| 72 20 74 68 65 20 73 63 | 72 69 70 74 20 6e 61 6d |r the sc|ript nam|
|00002800| 65 20 62 75 74 20 62 65 | 66 6f 72 65 20 61 6e 79 |e but be|fore any|
|00002810| 20 66 69 6c 65 6e 61 6d | 65 0d 20 20 20 20 20 61 | filenam|e. a|
|00002820| 72 67 75 6d 65 6e 74 73 | 20 28 6f 72 20 62 65 66 |rguments| (or bef|
|00002830| 6f 72 65 20 61 20 2d 2d | 29 2e 20 20 41 6e 79 20 |ore a --|). Any |
|00002840| 73 77 69 74 63 68 20 66 | 6f 75 6e 64 20 74 68 65 |switch f|ound the|
|00002850| 72 65 20 69 73 0d 20 20 | 20 20 20 72 65 6d 6f 76 |re is. | remov|
|00002860| 65 64 20 66 72 6f 6d 20 | 40 41 52 47 56 20 61 6e |ed from |@ARGV an|
|00002870| 64 20 73 65 74 73 20 74 | 68 65 20 63 6f 72 72 65 |d sets t|he corre|
|00002880| 73 70 6f 6e 64 69 6e 67 | 20 76 61 72 69 61 62 6c |sponding| variabl|
|00002890| 65 20 69 6e 0d 20 20 20 | 20 20 74 68 65 20 70 65 |e in. | the pe|
|000028a0| 72 6c 20 73 63 72 69 70 | 74 2e 20 20 54 68 65 20 |rl scrip|t. The |
|000028b0| 66 6f 6c 6c 6f 77 69 6e | 67 20 73 63 72 69 70 74 |followin|g script|
|000028c0| 20 70 72 69 6e 74 73 20 | 22 74 72 75 65 22 20 69 | prints |"true" i|
|000028d0| 66 20 61 6e 64 0d 20 20 | 20 20 20 6f 6e 6c 79 20 |f and. | only |
|000028e0| 69 66 20 74 68 65 20 73 | 63 72 69 70 74 20 69 73 |if the s|cript is|
|000028f0| 20 69 6e 76 6f 6b 65 64 | 20 77 69 74 68 20 61 20 | invoked| with a |
|00002900| 2d 78 79 7a 20 73 77 69 | 74 63 68 2e 0d 0d 20 20 |-xyz swi|tch... |
|00002910| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002920| 20 20 23 21 2f 75 73 72 | 2f 62 69 6e 2f 70 65 72 | #!/usr|/bin/per|
|00002930| 6c 20 2d 73 0d 20 20 20 | 20 20 20 20 20 20 20 20 |l -s. | |
|00002940| 20 20 20 20 20 20 20 20 | 20 69 66 20 28 24 78 79 | | if ($xy|
|00002950| 7a 29 20 7b 20 70 72 69 | 6e 74 20 22 74 72 75 65 |z) { pri|nt "true|
|00002960| 5c 6e 22 3b 20 7d 0d 0d | 0d 2d 53 20 20 20 6d 61 |\n"; }..|.-S ma|
|00002970| 6b 65 73 20 70 65 72 6c | 20 75 73 65 20 74 68 65 |kes perl| use the|
|00002980| 20 50 41 54 48 20 65 6e | 76 69 72 6f 6e 6d 65 6e | PATH en|vironmen|
|00002990| 74 20 76 61 72 69 61 62 | 6c 65 20 74 6f 20 73 65 |t variab|le to se|
|000029a0| 61 72 63 68 20 66 6f 72 | 0d 20 20 20 20 20 74 68 |arch for|. th|
|000029b0| 65 20 73 63 72 69 70 74 | 20 28 75 6e 6c 65 73 73 |e script| (unless|
|000029c0| 20 74 68 65 20 6e 61 6d | 65 20 6f 66 20 74 68 65 | the nam|e of the|
|000029d0| 20 73 63 72 69 70 74 20 | 73 74 61 72 74 73 20 77 | script |starts w|
|000029e0| 69 74 68 20 61 0d 20 20 | 20 20 20 73 6c 61 73 68 |ith a. | slash|
|000029f0| 29 2e 20 20 54 79 70 69 | 63 61 6c 6c 79 20 74 68 |). Typi|cally th|
|00002a00| 69 73 20 69 73 20 75 73 | 65 64 20 74 6f 20 65 6d |is is us|ed to em|
|00002a10| 75 6c 61 74 65 20 23 21 | 20 73 74 61 72 74 75 70 |ulate #!| startup|
|00002a20| 20 6f 6e 0d 20 20 20 20 | 20 6d 61 63 68 69 6e 65 | on. | machine|
|00002a30| 73 20 74 68 61 74 20 64 | 6f 6e 27 74 20 73 75 70 |s that d|on't sup|
|00002a40| 70 6f 72 74 20 23 21 2c | 20 69 6e 20 74 68 65 20 |port #!,| in the |
|00002a50| 66 6f 6c 6c 6f 77 69 6e | 67 20 6d 61 6e 6e 65 72 |followin|g manner|
|00002a60| 3a 0d 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |:.. | |
|00002a70| 20 20 20 20 20 20 20 23 | 21 2f 75 73 72 2f 62 69 | #|!/usr/bi|
|00002a80| 6e 2f 70 65 72 6c 0d 20 | 20 20 20 20 20 20 20 20 |n/perl. | |
|00002a90| 20 20 20 20 20 20 20 20 | 20 20 20 65 76 61 6c 20 | | eval |
|00002aa0| 22 65 78 65 63 20 2f 75 | 73 72 2f 62 69 6e 2f 70 |"exec /u|sr/bin/p|
|00002ab0| 65 72 6c 20 2d 53 20 24 | 30 20 24 2a 22 0d 20 20 |erl -S $|0 $*". |
|00002ac0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002ad0| 20 20 20 20 20 20 20 69 | 66 20 24 72 75 6e 6e 69 | i|f $runni|
|00002ae0| 6e 67 5f 75 6e 64 65 72 | 5f 73 6f 6d 65 5f 73 68 |ng_under|_some_sh|
|00002af0| 65 6c 6c 3b 0d 0d 20 20 | 20 20 20 54 68 65 20 73 |ell;.. | The s|
|00002b00| 79 73 74 65 6d 20 69 67 | 6e 6f 72 65 73 20 74 68 |ystem ig|nores th|
|00002b10| 65 20 66 69 72 73 74 20 | 6c 69 6e 65 20 61 6e 64 |e first |line and|
|00002b20| 20 66 65 65 64 73 20 74 | 68 65 20 73 63 72 69 70 | feeds t|he scrip|
|00002b30| 74 20 74 6f 0d 20 20 20 | 20 20 2f 62 69 6e 2f 73 |t to. | /bin/s|
|00002b40| 68 2c 20 77 68 69 63 68 | 20 70 72 6f 63 65 65 64 |h, which| proceed|
|00002b50| 73 20 74 6f 20 74 72 79 | 20 74 6f 20 65 78 65 63 |s to try| to exec|
|00002b60| 75 74 65 20 74 68 65 20 | 70 65 72 6c 20 73 63 72 |ute the |perl scr|
|00002b70| 69 70 74 20 61 73 0d 20 | 20 20 20 20 61 20 73 68 |ipt as. | a sh|
|00002b80| 65 6c 6c 20 73 63 72 69 | 70 74 2e 20 20 54 68 65 |ell scri|pt. The|
|00002b90| 20 73 68 65 6c 6c 20 65 | 78 65 63 75 74 65 73 20 | shell e|xecutes |
|00002ba0| 74 68 65 20 73 65 63 6f | 6e 64 20 6c 69 6e 65 20 |the seco|nd line |
|00002bb0| 61 73 20 61 0d 20 20 20 | 20 20 6e 6f 72 6d 61 6c |as a. | normal|
|00002bc0| 20 73 68 65 6c 6c 20 63 | 6f 6d 6d 61 6e 64 2c 20 | shell c|ommand, |
|00002bd0| 61 6e 64 20 74 68 75 73 | 20 73 74 61 72 74 73 20 |and thus| starts |
|00002be0| 75 70 20 74 68 65 20 70 | 65 72 6c 20 69 6e 74 65 |up the p|erl inte|
|00002bf0| 72 2d 0d 20 20 20 20 20 | 70 72 65 74 65 72 2e 20 |r-. |preter. |
|00002c00| 20 4f 6e 20 73 6f 6d 65 | 20 73 79 73 74 65 6d 73 | On some| systems|
|00002c10| 20 24 30 20 64 6f 65 73 | 6e 27 74 20 61 6c 77 61 | $0 does|n't alwa|
|00002c20| 79 73 20 63 6f 6e 74 61 | 69 6e 20 74 68 65 20 66 |ys conta|in the f|
|00002c30| 75 6c 6c 0d 20 20 20 20 | 20 70 61 74 68 6e 61 6d |ull. | pathnam|
|00002c40| 65 2c 20 73 6f 20 74 68 | 65 20 2d 53 20 74 65 6c |e, so th|e -S tel|
|00002c50| 6c 73 20 70 65 72 6c 20 | 74 6f 20 73 65 61 72 63 |ls perl |to searc|
|00002c60| 68 20 66 6f 72 20 74 68 | 65 20 73 63 72 69 70 74 |h for th|e script|
|00002c70| 20 69 66 0d 20 20 20 20 | 20 6e 65 63 65 73 73 61 | if. | necessa|
|00002c80| 72 79 2e 20 20 41 66 74 | 65 72 20 70 65 72 6c 20 |ry. Aft|er perl |
|00002c90| 6c 6f 63 61 74 65 73 20 | 74 68 65 20 73 63 72 69 |locates |the scri|
|00002ca0| 70 74 2c 20 69 74 20 70 | 61 72 73 65 73 20 74 68 |pt, it p|arses th|
|00002cb0| 65 0d 20 20 20 20 20 6c | 69 6e 65 73 20 61 6e 64 |e. l|ines and|
|00002cc0| 20 69 67 6e 6f 72 65 73 | 20 74 68 65 6d 20 62 65 | ignores| them be|
|00002cd0| 63 61 75 73 65 20 74 68 | 65 20 76 61 72 69 61 62 |cause th|e variab|
|00002ce0| 6c 65 0d 20 20 20 20 20 | 24 72 75 6e 6e 69 6e 67 |le. |$running|
|00002cf0| 5f 75 6e 64 65 72 5f 73 | 6f 6d 65 5f 73 68 65 6c |_under_s|ome_shel|
|00002d00| 6c 20 69 73 20 6e 65 76 | 65 72 20 74 72 75 65 2e |l is nev|er true.|
|00002d10| 20 20 41 20 62 65 74 74 | 65 72 20 63 6f 6e 73 74 | A bett|er const|
|00002d20| 72 75 63 74 0d 20 20 20 | 20 20 74 68 61 6e 20 24 |ruct. | than $|
|00002d30| 2a 20 77 6f 75 6c 64 20 | 62 65 20 24 7b 31 2b 22 |* would |be ${1+"|
|00002d40| 24 40 22 7d 2c 20 77 68 | 69 63 68 20 68 61 6e 64 |$@"}, wh|ich hand|
|00002d50| 6c 65 73 20 65 6d 62 65 | 64 64 65 64 20 73 70 61 |les embe|dded spa|
|00002d60| 63 65 73 0d 20 20 20 20 | 20 61 6e 64 20 73 75 63 |ces. | and suc|
|00002d70| 68 20 69 6e 20 74 68 65 | 20 66 69 6c 65 6e 61 6d |h in the| filenam|
|00002d80| 65 73 2c 20 62 75 74 20 | 64 6f 65 73 6e 27 74 20 |es, but |doesn't |
|00002d90| 77 6f 72 6b 20 69 66 20 | 74 68 65 20 73 63 72 69 |work if |the scri|
|00002da0| 70 74 20 69 73 0d 20 20 | 20 20 20 62 65 69 6e 67 |pt is. | being|
|00002db0| 20 69 6e 74 65 72 70 72 | 65 74 65 64 20 62 79 20 | interpr|eted by |
|00002dc0| 63 73 68 2e 20 20 49 6e | 20 6f 72 64 65 72 20 74 |csh. In| order t|
|00002dd0| 6f 20 73 74 61 72 74 20 | 75 70 20 73 68 20 72 61 |o start |up sh ra|
|00002de0| 74 68 65 72 0d 20 20 20 | 20 20 74 68 61 6e 20 63 |ther. | than c|
|00002df0| 73 68 2c 20 73 6f 6d 65 | 20 73 79 73 74 65 6d 73 |sh, some| systems|
|00002e00| 20 6d 61 79 20 68 61 76 | 65 20 74 6f 20 72 65 70 | may hav|e to rep|
|00002e10| 6c 61 63 65 20 74 68 65 | 20 23 21 20 6c 69 6e 65 |lace the| #! line|
|00002e20| 20 77 69 74 68 0d 20 20 | 20 20 20 61 20 6c 69 6e | with. | a lin|
|00002e30| 65 20 63 6f 6e 74 61 69 | 6e 69 6e 67 20 6a 75 73 |e contai|ning jus|
|00002e40| 74 20 61 20 63 6f 6c 6f | 6e 2c 20 77 68 69 63 68 |t a colo|n, which|
|00002e50| 20 77 69 6c 6c 20 62 65 | 20 70 6f 6c 69 74 65 6c | will be| politel|
|00002e60| 79 0d 20 20 20 20 20 69 | 67 6e 6f 72 65 64 20 62 |y. i|gnored b|
|00002e70| 79 20 70 65 72 6c 2e 20 | 20 4f 74 68 65 72 20 73 |y perl. | Other s|
|00002e80| 79 73 74 65 6d 73 20 63 | 61 6e 27 74 20 63 6f 6e |ystems c|an't con|
|00002e90| 74 72 6f 6c 20 74 68 61 | 74 2c 20 61 6e 64 20 6e |trol tha|t, and n|
|00002ea0| 65 65 64 0d 20 20 20 20 | 20 61 20 74 6f 74 61 6c |eed. | a total|
|00002eb0| 6c 79 20 64 65 76 69 6f | 75 73 20 63 6f 6e 73 74 |ly devio|us const|
|00002ec0| 72 75 63 74 20 74 68 61 | 74 20 77 69 6c 6c 20 77 |ruct tha|t will w|
|00002ed0| 6f 72 6b 20 75 6e 64 65 | 72 20 61 6e 79 20 6f 66 |ork unde|r any of|
|00002ee0| 20 63 73 68 2c 0d 20 20 | 20 20 20 73 68 20 6f 72 | csh,. | sh or|
|00002ef0| 20 70 65 72 6c 2c 20 73 | 75 63 68 20 61 73 20 74 | perl, s|uch as t|
|00002f00| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 3a 0d 0d 20 |he follo|wing:.. |
|00002f10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002f20| 20 20 20 65 76 61 6c 20 | 27 28 65 78 69 74 20 24 | eval |'(exit $|
|00002f30| 3f 30 29 27 20 26 26 20 | 65 76 61 6c 20 27 65 78 |?0)' && |eval 'ex|
|00002f40| 65 63 20 2f 75 73 72 2f | 62 69 6e 2f 70 65 72 6c |ec /usr/|bin/perl|
|00002f50| 20 2d 53 20 24 30 20 24 | 7b 31 2b 22 24 40 22 7d | -S $0 $|{1+"$@"}|
|00002f60| 27 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |'. | |
|00002f70| 20 20 20 20 20 20 26 20 | 65 76 61 6c 20 27 65 78 | & |eval 'ex|
|00002f80| 65 63 20 2f 75 73 72 2f | 62 69 6e 2f 70 65 72 6c |ec /usr/|bin/perl|
|00002f90| 20 2d 53 20 24 30 20 24 | 61 72 67 76 3a 71 27 0d | -S $0 $|argv:q'.|
|00002fa0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002fb0| 20 20 20 20 20 20 20 20 | 20 69 66 20 30 3b 0d 0d | | if 0;..|
|00002fc0| 0d 2d 75 20 20 20 63 61 | 75 73 65 73 20 70 65 72 |.-u ca|uses per|
|00002fd0| 6c 20 74 6f 20 64 75 6d | 70 20 63 6f 72 65 20 61 |l to dum|p core a|
|00002fe0| 66 74 65 72 20 63 6f 6d | 70 69 6c 69 6e 67 20 79 |fter com|piling y|
|00002ff0| 6f 75 72 20 73 63 72 69 | 70 74 2e 20 20 59 6f 75 |our scri|pt. You|
|00003000| 0d 20 20 20 20 20 63 61 | 6e 20 74 68 65 6e 20 74 |. ca|n then t|
|00003010| 61 6b 65 20 74 68 69 73 | 20 63 6f 72 65 20 64 75 |ake this| core du|
|00003020| 6d 70 20 61 6e 64 20 74 | 75 72 6e 20 69 74 20 69 |mp and t|urn it i|
|00003030| 6e 74 6f 20 61 6e 20 65 | 78 65 63 75 74 61 62 6c |nto an e|xecutabl|
|00003040| 65 0d 20 20 20 20 20 66 | 69 6c 65 20 62 79 20 75 |e. f|ile by u|
|00003050| 73 69 6e 67 20 74 68 65 | 20 75 6e 64 75 6d 70 20 |sing the| undump |
|00003060| 70 72 6f 67 72 61 6d 20 | 28 6e 6f 74 20 73 75 70 |program |(not sup|
|00003070| 70 6c 69 65 64 29 2e 20 | 20 54 68 69 73 0d 20 20 |plied). | This. |
|00003080| 20 20 20 73 70 65 65 64 | 73 20 73 74 61 72 74 75 | speed|s startu|
|00003090| 70 20 61 74 20 74 68 65 | 20 65 78 70 65 6e 73 65 |p at the| expense|
|000030a0| 20 6f 66 20 73 6f 6d 65 | 20 64 69 73 6b 20 73 70 | of some| disk sp|
|000030b0| 61 63 65 20 28 77 68 69 | 63 68 20 79 6f 75 0d 20 |ace (whi|ch you. |
|000030c0| 20 20 20 20 63 61 6e 20 | 6d 69 6e 69 6d 69 7a 65 | can |minimize|
|000030d0| 20 62 79 20 73 74 72 69 | 70 70 69 6e 67 20 74 68 | by stri|pping th|
|000030e0| 65 20 65 78 65 63 75 74 | 61 62 6c 65 29 2e 20 20 |e execut|able). |
|000030f0| 28 53 74 69 6c 6c 2c 20 | 61 20 22 68 65 6c 6c 6f |(Still, |a "hello|
|00003100| 0d 20 20 20 20 20 77 6f | 72 6c 64 22 20 65 78 65 |. wo|rld" exe|
|00003110| 63 75 74 61 62 6c 65 20 | 63 6f 6d 65 73 20 6f 75 |cutable |comes ou|
|00003120| 74 20 74 6f 20 61 62 6f | 75 74 20 32 30 30 4b 20 |t to abo|ut 200K |
|00003130| 6f 6e 20 6d 79 20 6d 61 | 63 68 69 6e 65 2e 29 20 |on my ma|chine.) |
|00003140| 49 66 0d 20 20 20 20 20 | 79 6f 75 20 61 72 65 20 |If. |you are |
|00003150| 67 6f 69 6e 67 20 74 6f | 20 72 75 6e 20 79 6f 75 |going to| run you|
|00003160| 72 20 65 78 65 63 75 74 | 61 62 6c 65 20 61 73 20 |r execut|able as |
|00003170| 61 20 73 65 74 2d 69 64 | 20 70 72 6f 67 72 61 6d |a set-id| program|
|00003180| 0d 20 20 20 20 20 74 68 | 65 6e 20 79 6f 75 20 73 |. th|en you s|
|00003190| 68 6f 75 6c 64 20 70 72 | 6f 62 61 62 6c 79 20 63 |hould pr|obably c|
|000031a0| 6f 6d 70 69 6c 65 20 69 | 74 20 75 73 69 6e 67 20 |ompile i|t using |
|000031b0| 74 61 69 6e 74 70 65 72 | 6c 20 72 61 74 68 65 72 |taintper|l rather|
|000031c0| 0d 20 20 20 20 20 74 68 | 61 6e 20 6e 6f 72 6d 61 |. th|an norma|
|000031d0| 6c 20 70 65 72 6c 2e 20 | 20 49 66 20 79 6f 75 20 |l perl. | If you |
|000031e0| 77 61 6e 74 20 74 6f 20 | 65 78 65 63 75 74 65 20 |want to |execute |
|000031f0| 61 20 70 6f 72 74 69 6f | 6e 20 6f 66 20 79 6f 75 |a portio|n of you|
|00003200| 72 0d 20 20 20 20 20 73 | 63 72 69 70 74 20 62 65 |r. s|cript be|
|00003210| 66 6f 72 65 20 64 75 6d | 70 69 6e 67 2c 20 75 73 |fore dum|ping, us|
|00003220| 65 20 74 68 65 20 64 75 | 6d 70 20 6f 70 65 72 61 |e the du|mp opera|
|00003230| 74 6f 72 20 69 6e 73 74 | 65 61 64 2e 20 20 4e 6f |tor inst|ead. No|
|00003240| 74 65 3a 0d 20 20 20 20 | 20 61 76 61 69 6c 61 62 |te:. | availab|
|00003250| 69 6c 69 74 79 20 6f 66 | 20 75 6e 64 75 6d 70 20 |ility of| undump |
|00003260| 69 73 20 70 6c 61 74 66 | 6f 72 6d 20 73 70 65 63 |is platf|orm spec|
|00003270| 69 66 69 63 20 61 6e 64 | 20 6d 61 79 20 6e 6f 74 |ific and| may not|
|00003280| 20 62 65 0d 20 20 20 20 | 20 61 76 61 69 6c 61 62 | be. | availab|
|00003290| 6c 65 20 66 6f 72 20 61 | 20 73 70 65 63 69 66 69 |le for a| specifi|
|000032a0| 63 20 70 6f 72 74 20 6f | 66 20 70 65 72 6c 2e 0d |c port o|f perl..|
|000032b0| 0d 2d 55 20 20 20 61 6c | 6c 6f 77 73 20 70 65 72 |.-U al|lows per|
|000032c0| 6c 20 74 6f 20 64 6f 20 | 75 6e 73 61 66 65 20 6f |l to do |unsafe o|
|000032d0| 70 65 72 61 74 69 6f 6e | 73 2e 20 20 43 75 72 72 |peration|s. Curr|
|000032e0| 65 6e 74 6c 79 20 74 68 | 65 20 6f 6e 6c 79 0d 20 |ently th|e only. |
|000032f0| 20 20 20 20 22 75 6e 73 | 61 66 65 22 20 6f 70 65 | "uns|afe" ope|
|00003300| 72 61 74 69 6f 6e 20 69 | 73 20 74 68 65 20 75 6e |ration i|s the un|
|00003310| 6c 69 6e 6b 69 6e 67 20 | 6f 66 20 64 69 72 65 63 |linking |of direc|
|00003320| 74 6f 72 69 65 73 20 77 | 68 69 6c 65 0d 20 20 20 |tories w|hile. |
|00003330| 20 20 72 75 6e 6e 69 6e | 67 20 61 73 20 73 75 70 | runnin|g as sup|
|00003340| 65 72 75 73 65 72 2e 0d | 0d 2d 76 20 20 20 70 72 |eruser..|.-v pr|
|00003350| 69 6e 74 73 20 74 68 65 | 20 76 65 72 73 69 6f 6e |ints the| version|
|00003360| 20 61 6e 64 20 70 61 74 | 63 68 6c 65 76 65 6c 20 | and pat|chlevel |
|00003370| 6f 66 20 79 6f 75 72 20 | 70 65 72 6c 20 65 78 65 |of your |perl exe|
|00003380| 63 75 74 61 62 6c 65 2e | 0d 0d 2d 77 20 20 20 70 |cutable.|..-w p|
|00003390| 72 69 6e 74 73 20 77 61 | 72 6e 69 6e 67 73 20 61 |rints wa|rnings a|
|000033a0| 62 6f 75 74 20 69 64 65 | 6e 74 69 66 69 65 72 73 |bout ide|ntifiers|
|000033b0| 20 74 68 61 74 20 61 72 | 65 20 6d 65 6e 74 69 6f | that ar|e mentio|
|000033c0| 6e 65 64 20 6f 6e 6c 79 | 0d 20 20 20 20 20 6f 6e |ned only|. on|
|000033d0| 63 65 2c 20 61 6e 64 20 | 73 63 61 6c 61 72 20 76 |ce, and |scalar v|
|000033e0| 61 72 69 61 62 6c 65 73 | 20 74 68 61 74 20 61 72 |ariables| that ar|
|000033f0| 65 20 75 73 65 64 20 62 | 65 66 6f 72 65 20 62 65 |e used b|efore be|
|00003400| 69 6e 67 20 73 65 74 2e | 0d 20 20 20 20 20 41 6c |ing set.|. Al|
|00003410| 73 6f 20 77 61 72 6e 73 | 20 61 62 6f 75 74 20 72 |so warns| about r|
|00003420| 65 64 65 66 69 6e 65 64 | 20 73 75 62 72 6f 75 74 |edefined| subrout|
|00003430| 69 6e 65 73 2c 20 61 6e | 64 20 72 65 66 65 72 65 |ines, an|d refere|
|00003440| 6e 63 65 73 20 74 6f 0d | 20 20 20 20 20 75 6e 64 |nces to.| und|
|00003450| 65 66 69 6e 65 64 20 66 | 69 6c 65 68 61 6e 64 6c |efined f|ilehandl|
|00003460| 65 73 20 6f 72 20 66 69 | 6c 65 68 61 6e 64 6c 65 |es or fi|lehandle|
|00003470| 73 20 6f 70 65 6e 65 64 | 20 72 65 61 64 6f 6e 6c |s opened| readonl|
|00003480| 79 20 74 68 61 74 0d 20 | 20 20 20 20 79 6f 75 20 |y that. | you |
|00003490| 61 72 65 20 61 74 74 65 | 6d 70 74 69 6e 67 20 74 |are atte|mpting t|
|000034a0| 6f 20 77 72 69 74 65 20 | 6f 6e 2e 20 20 41 6c 73 |o write |on. Als|
|000034b0| 6f 20 77 61 72 6e 73 20 | 79 6f 75 20 69 66 20 79 |o warns |you if y|
|000034c0| 6f 75 20 75 73 65 0d 20 | 20 20 20 20 3d 3d 20 6f |ou use. | == o|
|000034d0| 6e 20 76 61 6c 75 65 73 | 20 74 68 61 74 20 64 6f |n values| that do|
|000034e0| 6e 27 74 20 6c 6f 6f 6b | 20 6c 69 6b 65 20 6e 75 |n't look| like nu|
|000034f0| 6d 62 65 72 73 2c 20 61 | 6e 64 20 69 66 20 79 6f |mbers, a|nd if yo|
|00003500| 75 72 20 73 75 62 2d 0d | 20 20 20 20 20 72 6f 75 |ur sub-.| rou|
|00003510| 74 69 6e 65 73 20 72 65 | 63 75 72 73 65 20 6d 6f |tines re|curse mo|
|00003520| 72 65 20 74 68 61 6e 20 | 31 30 30 20 64 65 65 70 |re than |100 deep|
|00003530| 2e 0d 0d 2d 78 64 69 72 | 65 63 74 6f 72 79 0d 20 |...-xdir|ectory. |
|00003540| 20 20 20 20 74 65 6c 6c | 73 20 70 65 72 6c 20 74 | tell|s perl t|
|00003550| 68 61 74 20 74 68 65 20 | 73 63 72 69 70 74 20 69 |hat the |script i|
|00003560| 73 20 65 6d 62 65 64 64 | 65 64 20 69 6e 20 61 20 |s embedd|ed in a |
|00003570| 6d 65 73 73 61 67 65 2e | 20 20 4c 65 61 64 2d 0d |message.| Lead-.|
|00003580| 20 20 20 20 20 69 6e 67 | 20 67 61 72 62 61 67 65 | ing| garbage|
|00003590| 20 77 69 6c 6c 20 62 65 | 20 64 69 73 63 61 72 64 | will be| discard|
|000035a0| 65 64 20 75 6e 74 69 6c | 20 74 68 65 20 66 69 72 |ed until| the fir|
|000035b0| 73 74 20 6c 69 6e 65 20 | 74 68 61 74 0d 20 20 20 |st line |that. |
|000035c0| 20 20 73 74 61 72 74 73 | 20 77 69 74 68 20 23 21 | starts| with #!|
|000035d0| 20 61 6e 64 20 63 6f 6e | 74 61 69 6e 73 20 74 68 | and con|tains th|
|000035e0| 65 20 73 74 72 69 6e 67 | 20 22 70 65 72 6c 22 2e |e string| "perl".|
|000035f0| 20 20 41 6e 79 20 6d 65 | 61 6e 69 6e 67 2d 0d 20 | Any me|aning-. |
|00003600| 20 20 20 20 66 75 6c 20 | 73 77 69 74 63 68 65 73 | ful |switches|
|00003610| 20 6f 6e 20 74 68 61 74 | 20 6c 69 6e 65 20 77 69 | on that| line wi|
|00003620| 6c 6c 20 62 65 20 61 70 | 70 6c 69 65 64 20 28 62 |ll be ap|plied (b|
|00003630| 75 74 20 6f 6e 6c 79 20 | 6f 6e 65 0d 20 20 20 20 |ut only |one. |
|00003640| 20 67 72 6f 75 70 20 6f | 66 20 73 77 69 74 63 68 | group o|f switch|
|00003650| 65 73 2c 20 61 73 20 77 | 69 74 68 20 6e 6f 72 6d |es, as w|ith norm|
|00003660| 61 6c 20 23 21 20 70 72 | 6f 63 65 73 73 69 6e 67 |al #! pr|ocessing|
|00003670| 29 2e 20 20 49 66 20 61 | 0d 20 20 20 20 20 64 69 |). If a|. di|
|00003680| 72 65 63 74 6f 72 79 20 | 6e 61 6d 65 20 69 73 20 |rectory |name is |
|00003690| 73 70 65 63 69 66 69 65 | 64 2c 20 50 65 72 6c 20 |specifie|d, Perl |
|000036a0| 77 69 6c 6c 20 73 77 69 | 74 63 68 20 74 6f 20 74 |will swi|tch to t|
|000036b0| 68 61 74 20 64 69 72 65 | 63 2d 0d 20 20 20 20 20 |hat dire|c-. |
|000036c0| 74 6f 72 79 20 62 65 66 | 6f 72 65 20 72 75 6e 6e |tory bef|ore runn|
|000036d0| 69 6e 67 20 74 68 65 20 | 73 63 72 69 70 74 2e 20 |ing the |script. |
|000036e0| 20 54 68 65 20 2d 78 20 | 73 77 69 74 63 68 20 6f | The -x |switch o|
|000036f0| 6e 6c 79 20 63 6f 6e 74 | 72 6f 6c 73 0d 20 20 20 |nly cont|rols. |
|00003700| 20 20 74 68 65 20 74 68 | 65 20 64 69 73 70 6f 73 | the th|e dispos|
|00003710| 61 6c 20 6f 66 20 6c 65 | 61 64 69 6e 67 20 67 61 |al of le|ading ga|
|00003720| 72 62 61 67 65 2e 20 20 | 54 68 65 20 73 63 72 69 |rbage. |The scri|
|00003730| 70 74 20 6d 75 73 74 20 | 62 65 0d 20 20 20 20 20 |pt must |be. |
|00003740| 74 65 72 6d 69 6e 61 74 | 65 64 20 77 69 74 68 20 |terminat|ed with |
|00003750| 5f 5f 45 4e 44 5f 5f 20 | 69 66 20 74 68 65 72 65 |__END__ |if there|
|00003760| 20 69 73 20 74 72 61 69 | 6c 69 6e 67 20 67 61 72 | is trai|ling gar|
|00003770| 62 61 67 65 20 74 6f 20 | 62 65 0d 20 20 20 20 20 |bage to |be. |
|00003780| 69 67 6e 6f 72 65 64 20 | 28 74 68 65 20 73 63 72 |ignored |(the scr|
|00003790| 69 70 74 20 63 61 6e 20 | 70 72 6f 63 65 73 73 20 |ipt can |process |
|000037a0| 61 6e 79 20 6f 72 20 61 | 6c 6c 20 6f 66 20 74 68 |any or a|ll of th|
|000037b0| 65 20 74 72 61 69 6c 69 | 6e 67 0d 20 20 20 20 20 |e traili|ng. |
|000037c0| 67 61 72 62 61 67 65 20 | 76 69 61 20 74 68 65 20 |garbage |via the |
|000037d0| 44 41 54 41 20 66 69 6c | 65 68 61 6e 64 6c 65 20 |DATA fil|ehandle |
|000037e0| 69 66 20 64 65 73 69 72 | 65 64 29 2e 0d be 4b 59 |if desir|ed)...KY|
|000037f0| 20 50 65 72 6c c9 54 79 | 70 65 73 0d be 43 20 50 | Perl.Ty|pes..C P|
|00003800| 65 72 6c 20 68 61 73 20 | 74 68 72 65 65 20 64 61 |erl has |three da|
|00003810| 74 61 20 74 79 70 65 73 | 3a 20 73 63 61 6c 61 72 |ta types|: scalar|
|00003820| 73 2c 20 61 72 72 61 79 | 73 20 6f 66 20 73 63 61 |s, array|s of sca|
|00003830| 6c 61 72 73 2c 20 61 6e | 64 20 61 73 73 6f 2d 0d |lars, an|d asso-.|
|00003840| 63 69 61 74 69 76 65 20 | 61 72 72 61 79 73 20 6f |ciative |arrays o|
|00003850| 66 20 73 63 61 6c 61 72 | 73 2e 20 20 4e 6f 72 6d |f scalar|s. Norm|
|00003860| 61 6c 20 61 72 72 61 79 | 73 20 61 72 65 20 69 6e |al array|s are in|
|00003870| 64 65 78 65 64 20 62 79 | 20 6e 75 6d 62 65 72 2c |dexed by| number,|
|00003880| 0d 61 6e 64 20 61 73 73 | 6f 63 69 61 74 69 76 65 |.and ass|ociative|
|00003890| 20 61 72 72 61 79 73 20 | 62 79 20 73 74 72 69 6e | arrays |by strin|
|000038a0| 67 2e 0d 0d 54 68 65 20 | 69 6e 74 65 72 70 72 65 |g...The |interpre|
|000038b0| 74 61 74 69 6f 6e 20 6f | 66 20 6f 70 65 72 61 74 |tation o|f operat|
|000038c0| 69 6f 6e 73 20 61 6e 64 | 20 76 61 6c 75 65 73 20 |ions and| values |
|000038d0| 69 6e 20 70 65 72 6c 20 | 73 6f 6d 65 74 69 6d 65 |in perl |sometime|
|000038e0| 73 0d 64 65 70 65 6e 64 | 73 20 6f 6e 20 74 68 65 |s.depend|s on the|
|000038f0| 20 72 65 71 75 69 72 65 | 6d 65 6e 74 73 20 6f 66 | require|ments of|
|00003900| 20 74 68 65 20 63 6f 6e | 74 65 78 74 20 61 72 6f | the con|text aro|
|00003910| 75 6e 64 20 74 68 65 20 | 6f 70 65 72 61 74 69 6f |und the |operatio|
|00003920| 6e 0d 6f 72 20 76 61 6c | 75 65 2e 20 20 54 68 65 |n.or val|ue. The|
|00003930| 72 65 20 61 72 65 20 74 | 68 72 65 65 20 6d 61 6a |re are t|hree maj|
|00003940| 6f 72 20 63 6f 6e 74 65 | 78 74 73 3a 20 73 74 72 |or conte|xts: str|
|00003950| 69 6e 67 2c 20 6e 75 6d | 65 72 69 63 20 61 6e 64 |ing, num|eric and|
|00003960| 0d 61 72 72 61 79 2e 20 | 20 43 65 72 74 61 69 6e |.array. | Certain|
|00003970| 20 6f 70 65 72 61 74 69 | 6f 6e 73 20 72 65 74 75 | operati|ons retu|
|00003980| 72 6e 20 61 72 72 61 79 | 20 76 61 6c 75 65 73 20 |rn array| values |
|00003990| 69 6e 20 63 6f 6e 74 65 | 78 74 73 20 77 61 6e 74 |in conte|xts want|
|000039a0| 2d 0d 69 6e 67 20 61 6e | 20 61 72 72 61 79 2c 20 |-.ing an| array, |
|000039b0| 61 6e 64 20 73 63 61 6c | 61 72 20 76 61 6c 75 65 |and scal|ar value|
|000039c0| 73 20 6f 74 68 65 72 77 | 69 73 65 2e 20 20 28 49 |s otherw|ise. (I|
|000039d0| 66 20 74 68 69 73 20 69 | 73 20 74 72 75 65 20 6f |f this i|s true o|
|000039e0| 66 0d 61 6e 20 6f 70 65 | 72 61 74 69 6f 6e 20 69 |f.an ope|ration i|
|000039f0| 74 20 77 69 6c 6c 20 62 | 65 20 6d 65 6e 74 69 6f |t will b|e mentio|
|00003a00| 6e 65 64 20 69 6e 20 74 | 68 65 20 64 6f 63 75 6d |ned in t|he docum|
|00003a10| 65 6e 74 61 74 69 6f 6e | 20 66 6f 72 20 74 68 61 |entation| for tha|
|00003a20| 74 0d 6f 70 65 72 61 74 | 69 6f 6e 2e 29 20 4f 70 |t.operat|ion.) Op|
|00003a30| 65 72 61 74 69 6f 6e 73 | 20 77 68 69 63 68 20 72 |erations| which r|
|00003a40| 65 74 75 72 6e 20 73 63 | 61 6c 61 72 73 20 64 6f |eturn sc|alars do|
|00003a50| 6e 27 74 20 63 61 72 65 | 20 77 68 65 74 68 65 72 |n't care| whether|
|00003a60| 0d 74 68 65 20 63 6f 6e | 74 65 78 74 20 69 73 20 |.the con|text is |
|00003a70| 6c 6f 6f 6b 69 6e 67 20 | 66 6f 72 20 61 20 73 74 |looking |for a st|
|00003a80| 72 69 6e 67 20 6f 72 20 | 61 20 6e 75 6d 62 65 72 |ring or |a number|
|00003a90| 2c 20 62 75 74 20 73 63 | 61 6c 61 72 20 76 61 72 |, but sc|alar var|
|00003aa0| 69 2d 0d 61 62 6c 65 73 | 20 61 6e 64 20 76 61 6c |i-.ables| and val|
|00003ab0| 75 65 73 20 61 72 65 20 | 69 6e 74 65 72 70 72 65 |ues are |interpre|
|00003ac0| 74 65 64 20 61 73 20 73 | 74 72 69 6e 67 73 20 6f |ted as s|trings o|
|00003ad0| 72 20 6e 75 6d 62 65 72 | 73 20 61 73 0d 61 70 70 |r number|s as.app|
|00003ae0| 72 6f 70 72 69 61 74 65 | 20 74 6f 20 74 68 65 20 |ropriate| to the |
|00003af0| 63 6f 6e 74 65 78 74 2e | 20 20 41 20 73 63 61 6c |context.| A scal|
|00003b00| 61 72 20 69 73 20 69 6e | 74 65 72 70 72 65 74 65 |ar is in|terprete|
|00003b10| 64 20 61 73 20 54 52 55 | 45 20 69 6e 0d 74 68 65 |d as TRU|E in.the|
|00003b20| 20 62 6f 6f 6c 65 61 6e | 20 73 65 6e 73 65 20 69 | boolean| sense i|
|00003b30| 66 20 69 74 20 69 73 20 | 6e 6f 74 20 74 68 65 20 |f it is |not the |
|00003b40| 6e 75 6c 6c 20 73 74 72 | 69 6e 67 20 6f 72 20 30 |null str|ing or 0|
|00003b50| 2e 20 20 42 6f 6f 6c 65 | 61 6e 73 0d 72 65 74 75 |. Boole|ans.retu|
|00003b60| 72 6e 65 64 20 62 79 20 | 6f 70 65 72 61 74 6f 72 |rned by |operator|
|00003b70| 73 20 61 72 65 20 31 20 | 66 6f 72 20 74 72 75 65 |s are 1 |for true|
|00003b80| 20 61 6e 64 20 30 20 6f | 72 20 27 27 20 28 74 68 | and 0 o|r '' (th|
|00003b90| 65 20 6e 75 6c 6c 0d 73 | 74 72 69 6e 67 29 20 66 |e null.s|tring) f|
|00003ba0| 6f 72 20 66 61 6c 73 65 | 2e 0d 0d 54 68 65 72 65 |or false|...There|
|00003bb0| 20 61 72 65 20 61 63 74 | 75 61 6c 6c 79 20 74 77 | are act|ually tw|
|00003bc0| 6f 20 76 61 72 69 65 74 | 69 65 73 20 6f 66 20 6e |o variet|ies of n|
|00003bd0| 75 6c 6c 20 73 74 72 69 | 6e 67 3a 20 64 65 66 69 |ull stri|ng: defi|
|00003be0| 6e 65 64 20 61 6e 64 0d | 75 6e 64 65 66 69 6e 65 |ned and.|undefine|
|00003bf0| 64 2e 20 20 55 6e 64 65 | 66 69 6e 65 64 20 6e 75 |d. Unde|fined nu|
|00003c00| 6c 6c 20 73 74 72 69 6e | 67 73 20 61 72 65 20 72 |ll strin|gs are r|
|00003c10| 65 74 75 72 6e 65 64 20 | 77 68 65 6e 20 74 68 65 |eturned |when the|
|00003c20| 72 65 20 69 73 20 6e 6f | 0d 72 65 61 6c 20 76 61 |re is no|.real va|
|00003c30| 6c 75 65 20 66 6f 72 20 | 73 6f 6d 65 74 68 69 6e |lue for |somethin|
|00003c40| 67 2c 20 73 75 63 68 20 | 61 73 20 77 68 65 6e 20 |g, such |as when |
|00003c50| 74 68 65 72 65 20 77 61 | 73 20 61 6e 20 65 72 72 |there wa|s an err|
|00003c60| 6f 72 2c 20 6f 72 20 61 | 74 0d 65 6e 64 20 6f 66 |or, or a|t.end of|
|00003c70| 20 66 69 6c 65 2c 20 6f | 72 20 77 68 65 6e 20 79 | file, o|r when y|
|00003c80| 6f 75 20 72 65 66 65 72 | 20 74 6f 20 61 6e 20 75 |ou refer| to an u|
|00003c90| 6e 69 6e 69 74 69 61 6c | 69 7a 65 64 20 76 61 72 |ninitial|ized var|
|00003ca0| 69 61 62 6c 65 20 6f 72 | 0d 65 6c 65 6d 65 6e 74 |iable or|.element|
|00003cb0| 20 6f 66 20 61 6e 20 61 | 72 72 61 79 2e 20 20 41 | of an a|rray. A|
|00003cc0| 6e 20 75 6e 64 65 66 69 | 6e 65 64 20 6e 75 6c 6c |n undefi|ned null|
|00003cd0| 20 73 74 72 69 6e 67 20 | 6d 61 79 20 62 65 63 6f | string |may beco|
|00003ce0| 6d 65 20 64 65 66 69 6e | 65 64 0d 74 68 65 20 66 |me defin|ed.the f|
|00003cf0| 69 72 73 74 20 74 69 6d | 65 20 79 6f 75 20 61 63 |irst tim|e you ac|
|00003d00| 63 65 73 73 20 69 74 2c | 20 62 75 74 20 70 72 69 |cess it,| but pri|
|00003d10| 6f 72 20 74 6f 20 74 68 | 61 74 20 79 6f 75 20 63 |or to th|at you c|
|00003d20| 61 6e 20 75 73 65 20 74 | 68 65 0d 64 65 66 69 6e |an use t|he.defin|
|00003d30| 65 64 28 29 20 6f 70 65 | 72 61 74 6f 72 20 74 6f |ed() ope|rator to|
|00003d40| 20 64 65 74 65 72 6d 69 | 6e 65 20 77 68 65 74 68 | determi|ne wheth|
|00003d50| 65 72 20 74 68 65 20 76 | 61 6c 75 65 20 69 73 20 |er the v|alue is |
|00003d60| 64 65 66 69 6e 65 64 20 | 6f 72 0d 6e 6f 74 2e 0d |defined |or.not..|
|00003d70| 0d 52 65 66 65 72 65 6e | 63 65 73 20 74 6f 20 73 |.Referen|ces to s|
|00003d80| 63 61 6c 61 72 20 76 61 | 72 69 61 62 6c 65 73 20 |calar va|riables |
|00003d90| 61 6c 77 61 79 73 20 62 | 65 67 69 6e 20 77 69 74 |always b|egin wit|
|00003da0| 68 20 27 24 27 2c 20 65 | 76 65 6e 20 77 68 65 6e |h '$', e|ven when|
|00003db0| 0d 72 65 66 65 72 72 69 | 6e 67 20 74 6f 20 61 20 |.referri|ng to a |
|00003dc0| 73 63 61 6c 61 72 20 74 | 68 61 74 20 69 73 20 70 |scalar t|hat is p|
|00003dd0| 61 72 74 20 6f 66 20 61 | 6e 20 61 72 72 61 79 2e |art of a|n array.|
|00003de0| 20 20 54 68 75 73 3a 0d | 0d 20 20 20 20 20 20 20 | Thus:.|. |
|00003df0| 20 20 20 24 64 61 79 73 | 20 20 20 20 20 20 20 20 | $days| |
|00003e00| 20 20 20 23 20 61 20 73 | 69 6d 70 6c 65 20 73 63 | # a s|imple sc|
|00003e10| 61 6c 61 72 20 76 61 72 | 69 61 62 6c 65 0d 20 20 |alar var|iable. |
|00003e20| 20 20 20 20 20 20 20 20 | 24 64 61 79 73 5b 32 38 | |$days[28|
|00003e30| 5d 20 20 20 20 20 20 20 | 23 20 32 39 74 68 20 65 |] |# 29th e|
|00003e40| 6c 65 6d 65 6e 74 20 6f | 66 20 61 72 72 61 79 20 |lement o|f array |
|00003e50| 40 64 61 79 73 0d 20 20 | 20 20 20 20 20 20 20 20 |@days. | |
|00003e60| 24 64 61 79 73 7b 27 46 | 65 62 27 7d 20 20 20 20 |$days{'F|eb'} |
|00003e70| 23 20 6f 6e 65 20 76 61 | 6c 75 65 20 66 72 6f 6d |# one va|lue from|
|00003e80| 20 61 6e 20 61 73 73 6f | 63 69 61 74 69 76 65 20 | an asso|ciative |
|00003e90| 61 72 72 61 79 0d 20 20 | 20 20 20 20 20 20 20 20 |array. | |
|00003ea0| 24 23 64 61 79 73 20 20 | 20 20 20 20 20 20 20 20 |$#days | |
|00003eb0| 23 20 6c 61 73 74 20 69 | 6e 64 65 78 20 6f 66 20 |# last i|ndex of |
|00003ec0| 61 72 72 61 79 20 40 64 | 61 79 73 0d 0d 62 75 74 |array @d|ays..but|
|00003ed0| 20 65 6e 74 69 72 65 20 | 61 72 72 61 79 73 20 6f | entire |arrays o|
|00003ee0| 72 20 61 72 72 61 79 20 | 73 6c 69 63 65 73 20 61 |r array |slices a|
|00003ef0| 72 65 20 64 65 6e 6f 74 | 65 64 20 62 79 20 27 40 |re denot|ed by '@|
|00003f00| 27 3a 0d 0d 20 20 20 20 | 20 20 20 20 20 20 40 64 |':.. | @d|
|00003f10| 61 79 73 20 20 20 20 20 | 20 20 20 20 20 20 23 20 |ays | # |
|00003f20| 28 24 64 61 79 73 5b 30 | 5d 2c 20 24 64 61 79 73 |($days[0|], $days|
|00003f30| 5b 31 5d 2c 2e 2e 2e 20 | 24 64 61 79 73 5b 6e 5d |[1],... |$days[n]|
|00003f40| 29 0d 20 20 20 20 20 20 | 20 20 20 20 40 64 61 79 |). | @day|
|00003f50| 73 5b 33 2c 34 2c 35 5d | 20 20 20 20 23 20 73 61 |s[3,4,5]| # sa|
|00003f60| 6d 65 20 61 73 20 40 64 | 61 79 73 5b 33 2e 2e 35 |me as @d|ays[3..5|
|00003f70| 5d 0d 20 20 20 20 20 20 | 20 20 20 20 40 64 61 79 |]. | @day|
|00003f80| 73 7b 27 61 27 2c 27 63 | 27 7d 20 20 23 20 73 61 |s{'a','c|'} # sa|
|00003f90| 6d 65 20 61 73 20 28 24 | 64 61 79 73 7b 27 61 27 |me as ($|days{'a'|
|00003fa0| 7d 2c 24 64 61 79 73 7b | 27 63 27 7d 29 0d 0d 61 |},$days{|'c'})..a|
|00003fb0| 6e 64 20 65 6e 74 69 72 | 65 20 61 73 73 6f 63 69 |nd entir|e associ|
|00003fc0| 61 74 69 76 65 20 61 72 | 72 61 79 73 20 61 72 65 |ative ar|rays are|
|00003fd0| 20 64 65 6e 6f 74 65 64 | 20 62 79 20 27 25 27 3a | denoted| by '%':|
|00003fe0| 0d 0d 20 20 20 20 20 20 | 20 20 20 20 25 64 61 79 |.. | %day|
|00003ff0| 73 20 20 20 20 20 20 20 | 20 20 20 20 23 20 28 6b |s | # (k|
|00004000| 65 79 31 2c 20 76 61 6c | 31 2c 20 6b 65 79 32 2c |ey1, val|1, key2,|
|00004010| 20 76 61 6c 32 20 2e 2e | 2e 29 0d 0d 41 6e 79 20 | val2 ..|.)..Any |
|00004020| 6f 66 20 74 68 65 73 65 | 20 65 69 67 68 74 20 63 |of these| eight c|
|00004030| 6f 6e 73 74 72 75 63 74 | 73 20 6d 61 79 20 73 65 |onstruct|s may se|
|00004040| 72 76 65 20 61 73 20 61 | 6e 20 6c 76 61 6c 75 65 |rve as a|n lvalue|
|00004050| 2c 20 74 68 61 74 20 69 | 73 2c 0d 6d 61 79 20 62 |, that i|s,.may b|
|00004060| 65 20 61 73 73 69 67 6e | 65 64 20 74 6f 2e 20 20 |e assign|ed to. |
|00004070| 28 49 74 20 61 6c 73 6f | 20 74 75 72 6e 73 20 6f |(It also| turns o|
|00004080| 75 74 20 74 68 61 74 20 | 61 6e 20 61 73 73 69 67 |ut that |an assig|
|00004090| 6e 6d 65 6e 74 20 69 73 | 0d 69 74 73 65 6c 66 20 |nment is|.itself |
|000040a0| 61 6e 20 6c 76 61 6c 75 | 65 20 69 6e 20 63 65 72 |an lvalu|e in cer|
|000040b0| 74 61 69 6e 20 63 6f 6e | 74 65 78 74 73 2d 2d 73 |tain con|texts--s|
|000040c0| 65 65 20 65 78 61 6d 70 | 6c 65 73 20 75 6e 64 65 |ee examp|les unde|
|000040d0| 72 20 73 2c 20 74 72 0d | 61 6e 64 20 63 68 6f 70 |r s, tr.|and chop|
|000040e0| 2e 29 20 41 73 73 69 67 | 6e 6d 65 6e 74 20 74 6f |.) Assig|nment to|
|000040f0| 20 61 20 73 63 61 6c 61 | 72 20 65 76 61 6c 75 61 | a scala|r evalua|
|00004100| 74 65 73 20 74 68 65 20 | 72 69 67 68 74 68 61 6e |tes the |righthan|
|00004110| 64 20 73 69 64 65 20 69 | 6e 0d 61 20 73 63 61 6c |d side i|n.a scal|
|00004120| 61 72 20 63 6f 6e 74 65 | 78 74 2c 20 77 68 69 6c |ar conte|xt, whil|
|00004130| 65 20 61 73 73 69 67 6e | 6d 65 6e 74 20 74 6f 20 |e assign|ment to |
|00004140| 61 6e 20 61 72 72 61 79 | 20 6f 72 20 61 72 72 61 |an array| or arra|
|00004150| 79 20 73 6c 69 63 65 0d | 65 76 61 6c 75 61 74 65 |y slice.|evaluate|
|00004160| 73 20 74 68 65 20 72 69 | 67 68 74 68 61 6e 64 20 |s the ri|ghthand |
|00004170| 73 69 64 65 20 69 6e 20 | 61 6e 20 61 72 72 61 79 |side in |an array|
|00004180| 20 63 6f 6e 74 65 78 74 | 2e 0d 0d 59 6f 75 20 6d | context|...You m|
|00004190| 61 79 20 66 69 6e 64 20 | 74 68 65 20 6c 65 6e 67 |ay find |the leng|
|000041a0| 74 68 20 6f 66 20 61 72 | 72 61 79 20 40 64 61 79 |th of ar|ray @day|
|000041b0| 73 20 62 79 20 65 76 61 | 6c 75 61 74 69 6e 67 20 |s by eva|luating |
|000041c0| 22 24 23 64 61 79 73 22 | 2c 20 61 73 0d 69 6e 20 |"$#days"|, as.in |
|000041d0| 63 73 68 2e 20 20 28 41 | 63 74 75 61 6c 6c 79 2c |csh. (A|ctually,|
|000041e0| 20 69 74 27 73 20 6e 6f | 74 20 74 68 65 20 6c 65 | it's no|t the le|
|000041f0| 6e 67 74 68 20 6f 66 20 | 74 68 65 20 61 72 72 61 |ngth of |the arra|
|00004200| 79 2c 20 69 74 27 73 20 | 74 68 65 0d 73 75 62 73 |y, it's |the.subs|
|00004210| 63 72 69 70 74 20 6f 66 | 20 74 68 65 20 6c 61 73 |cript of| the las|
|00004220| 74 20 65 6c 65 6d 65 6e | 74 2c 20 73 69 6e 63 65 |t elemen|t, since|
|00004230| 20 74 68 65 72 65 20 69 | 73 20 28 6f 72 64 69 6e | there i|s (ordin|
|00004240| 61 72 69 6c 79 29 20 61 | 20 30 74 68 0d 65 6c 65 |arily) a| 0th.ele|
|00004250| 6d 65 6e 74 2e 29 20 41 | 73 73 69 67 6e 69 6e 67 |ment.) A|ssigning|
|00004260| 20 74 6f 20 24 23 64 61 | 79 73 20 63 68 61 6e 67 | to $#da|ys chang|
|00004270| 65 73 20 74 68 65 20 6c | 65 6e 67 74 68 20 6f 66 |es the l|ength of|
|00004280| 20 74 68 65 20 61 72 72 | 61 79 2e 0d 53 68 6f 72 | the arr|ay..Shor|
|00004290| 74 65 6e 69 6e 67 20 61 | 6e 20 61 72 72 61 79 20 |tening a|n array |
|000042a0| 62 79 20 74 68 69 73 20 | 6d 65 74 68 6f 64 20 64 |by this |method d|
|000042b0| 6f 65 73 20 6e 6f 74 20 | 61 63 74 75 61 6c 6c 79 |oes not |actually|
|000042c0| 20 64 65 73 74 72 6f 79 | 20 61 6e 79 0d 76 61 6c | destroy| any.val|
|000042d0| 75 65 73 2e 20 20 4c 65 | 6e 67 74 68 65 6e 69 6e |ues. Le|ngthenin|
|000042e0| 67 20 61 6e 20 61 72 72 | 61 79 20 74 68 61 74 20 |g an arr|ay that |
|000042f0| 77 61 73 20 70 72 65 76 | 69 6f 75 73 6c 79 20 73 |was prev|iously s|
|00004300| 68 6f 72 74 65 6e 65 64 | 0d 72 65 63 6f 76 65 72 |hortened|.recover|
|00004310| 73 20 74 68 65 20 76 61 | 6c 75 65 73 20 74 68 61 |s the va|lues tha|
|00004320| 74 20 77 65 72 65 20 69 | 6e 20 74 68 6f 73 65 20 |t were i|n those |
|00004330| 65 6c 65 6d 65 6e 74 73 | 2e 20 20 59 6f 75 20 63 |elements|. You c|
|00004340| 61 6e 20 61 6c 73 6f 0d | 67 61 69 6e 20 73 6f 6d |an also.|gain som|
|00004350| 65 20 6d 65 61 73 75 72 | 65 20 6f 66 20 65 66 66 |e measur|e of eff|
|00004360| 69 63 69 65 6e 63 79 20 | 62 79 20 70 72 65 65 78 |iciency |by preex|
|00004370| 74 65 6e 64 69 6e 67 20 | 61 6e 20 61 72 72 61 79 |tending |an array|
|00004380| 20 74 68 61 74 20 69 73 | 0d 67 6f 69 6e 67 20 74 | that is|.going t|
|00004390| 6f 20 67 65 74 20 62 69 | 67 2e 20 20 28 59 6f 75 |o get bi|g. (You|
|000043a0| 20 63 61 6e 20 61 6c 73 | 6f 20 65 78 74 65 6e 64 | can als|o extend|
|000043b0| 20 61 6e 20 61 72 72 61 | 79 20 62 79 20 61 73 73 | an arra|y by ass|
|000043c0| 69 67 6e 69 6e 67 20 74 | 6f 0d 61 6e 20 65 6c 65 |igning t|o.an ele|
|000043d0| 6d 65 6e 74 20 74 68 61 | 74 20 69 73 20 6f 66 66 |ment tha|t is off|
|000043e0| 20 74 68 65 20 65 6e 64 | 20 6f 66 20 74 68 65 20 | the end| of the |
|000043f0| 61 72 72 61 79 2e 20 20 | 54 68 69 73 20 64 69 66 |array. |This dif|
|00004400| 66 65 72 73 20 66 72 6f | 6d 0d 61 73 73 69 67 6e |fers fro|m.assign|
|00004410| 69 6e 67 20 74 6f 20 24 | 23 77 68 61 74 65 76 65 |ing to $|#whateve|
|00004420| 72 20 69 6e 20 74 68 61 | 74 20 69 6e 74 65 72 76 |r in tha|t interv|
|00004430| 65 6e 69 6e 67 20 76 61 | 6c 75 65 73 20 61 72 65 |ening va|lues are|
|00004440| 20 73 65 74 20 74 6f 0d | 6e 75 6c 6c 20 72 61 74 | set to.|null rat|
|00004450| 68 65 72 20 74 68 61 6e | 20 72 65 63 6f 76 65 72 |her than| recover|
|00004460| 65 64 2e 29 20 59 6f 75 | 20 63 61 6e 20 74 72 75 |ed.) You| can tru|
|00004470| 6e 63 61 74 65 20 61 6e | 20 61 72 72 61 79 20 64 |ncate an| array d|
|00004480| 6f 77 6e 20 74 6f 0d 6e | 6f 74 68 69 6e 67 20 62 |own to.n|othing b|
|00004490| 79 20 61 73 73 69 67 6e | 69 6e 67 20 74 68 65 20 |y assign|ing the |
|000044a0| 6e 75 6c 6c 20 6c 69 73 | 74 20 28 29 20 74 6f 20 |null lis|t () to |
|000044b0| 69 74 2e 20 20 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |it. The| followi|
|000044c0| 6e 67 20 61 72 65 0d 65 | 78 61 63 74 6c 79 20 65 |ng are.e|xactly e|
|000044d0| 71 75 69 76 61 6c 65 6e | 74 0d 0d 20 20 20 20 20 |quivalen|t.. |
|000044e0| 40 77 68 61 74 65 76 65 | 72 20 3d 20 28 29 3b 0d |@whateve|r = ();.|
|000044f0| 20 20 20 20 20 24 23 77 | 68 61 74 65 76 65 72 20 | $#w|hatever |
|00004500| 3d 20 24 5b 20 2d 20 31 | 3b 0d 0d 0d 49 66 20 79 |= $[ - 1|;...If y|
|00004510| 6f 75 20 65 76 61 6c 75 | 61 74 65 20 61 6e 20 61 |ou evalu|ate an a|
|00004520| 72 72 61 79 20 69 6e 20 | 61 20 73 63 61 6c 61 72 |rray in |a scalar|
|00004530| 20 63 6f 6e 74 65 78 74 | 2c 20 69 74 20 72 65 74 | context|, it ret|
|00004540| 75 72 6e 73 20 74 68 65 | 0d 6c 65 6e 67 74 68 20 |urns the|.length |
|00004550| 6f 66 20 74 68 65 20 61 | 72 72 61 79 2e 20 20 54 |of the a|rray. T|
|00004560| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 69 73 20 |he follo|wing is |
|00004570| 61 6c 77 61 79 73 20 74 | 72 75 65 3a 0d 0d 20 20 |always t|rue:.. |
|00004580| 20 20 20 73 63 61 6c 61 | 72 28 40 77 68 61 74 65 | scala|r(@whate|
|00004590| 76 65 72 29 20 3d 3d 20 | 24 23 77 68 61 74 65 76 |ver) == |$#whatev|
|000045a0| 65 72 20 2d 20 24 5b 20 | 2b 20 31 3b 0d 0d 49 66 |er - $[ |+ 1;..If|
|000045b0| 20 79 6f 75 20 65 76 61 | 6c 75 61 74 65 20 61 6e | you eva|luate an|
|000045c0| 20 61 73 73 6f 63 69 61 | 74 69 76 65 20 61 72 72 | associa|tive arr|
|000045d0| 61 79 20 69 6e 20 61 20 | 73 63 61 6c 61 72 20 63 |ay in a |scalar c|
|000045e0| 6f 6e 74 65 78 74 2c 20 | 69 74 20 72 65 74 75 72 |ontext, |it retur|
|000045f0| 6e 73 0d 61 20 76 61 6c | 75 65 20 77 68 69 63 68 |ns.a val|ue which|
|00004600| 20 69 73 20 74 72 75 65 | 20 69 66 20 61 6e 64 20 | is true| if and |
|00004610| 6f 6e 6c 79 20 69 66 20 | 74 68 65 20 61 72 72 61 |only if |the arra|
|00004620| 79 20 63 6f 6e 74 61 69 | 6e 73 20 61 6e 79 20 65 |y contai|ns any e|
|00004630| 6c 65 6d 65 6e 74 73 2e | 0d 28 49 66 20 74 68 65 |lements.|.(If the|
|00004640| 72 65 20 61 72 65 20 61 | 6e 79 20 65 6c 65 6d 65 |re are a|ny eleme|
|00004650| 6e 74 73 2c 20 74 68 65 | 20 76 61 6c 75 65 20 72 |nts, the| value r|
|00004660| 65 74 75 72 6e 65 64 20 | 69 73 20 61 20 73 74 72 |eturned |is a str|
|00004670| 69 6e 67 20 63 6f 6e 73 | 69 73 74 69 6e 67 0d 6f |ing cons|isting.o|
|00004680| 66 20 74 68 65 20 6e 75 | 6d 62 65 72 20 6f 66 20 |f the nu|mber of |
|00004690| 75 73 65 64 20 62 75 63 | 6b 65 74 73 20 61 6e 64 |used buc|kets and|
|000046a0| 20 74 68 65 20 6e 75 6d | 62 65 72 20 6f 66 20 61 | the num|ber of a|
|000046b0| 6c 6c 6f 63 61 74 65 64 | 20 62 75 63 6b 65 74 73 |llocated| buckets|
|000046c0| 2c 20 0d 73 65 70 61 72 | 61 74 65 64 20 62 79 20 |, .separ|ated by |
|000046d0| 61 20 73 6c 61 73 68 2e | 29 0d 0d 4d 75 6c 74 69 |a slash.|)..Multi|
|000046e0| 2d 64 69 6d 65 6e 73 69 | 6f 6e 61 6c 20 61 72 72 |-dimensi|onal arr|
|000046f0| 61 79 73 20 61 72 65 20 | 6e 6f 74 20 64 69 72 65 |ays are |not dire|
|00004700| 63 74 6c 79 20 73 75 70 | 70 6f 72 74 65 64 2c 20 |ctly sup|ported, |
|00004710| 62 75 74 20 73 65 65 20 | 74 68 65 0d 64 69 73 63 |but see |the.disc|
|00004720| 75 73 73 69 6f 6e 20 6f | 66 20 74 68 65 20 24 3b |ussion o|f the $;|
|00004730| 20 76 61 72 69 61 62 6c | 65 20 6c 61 74 65 72 20 | variabl|e later |
|00004740| 66 6f 72 20 61 20 6d 65 | 61 6e 73 20 6f 66 20 65 |for a me|ans of e|
|00004750| 6d 75 6c 61 74 69 6e 67 | 20 6d 75 6c 2d 0d 74 69 |mulating| mul-.ti|
|00004760| 70 6c 65 20 73 75 62 73 | 63 72 69 70 74 73 20 77 |ple subs|cripts w|
|00004770| 69 74 68 20 61 6e 20 61 | 73 73 6f 63 69 61 74 69 |ith an a|ssociati|
|00004780| 76 65 20 61 72 72 61 79 | 2e 20 20 59 6f 75 20 63 |ve array|. You c|
|00004790| 6f 75 6c 64 20 61 6c 73 | 6f 20 77 72 69 74 65 0d |ould als|o write.|
|000047a0| 61 20 73 75 62 72 6f 75 | 74 69 6e 65 20 74 6f 20 |a subrou|tine to |
|000047b0| 74 75 72 6e 20 6d 75 6c | 74 69 70 6c 65 20 73 75 |turn mul|tiple su|
|000047c0| 62 73 63 72 69 70 74 73 | 20 69 6e 74 6f 20 61 20 |bscripts| into a |
|000047d0| 73 69 6e 67 6c 65 20 73 | 75 62 73 63 72 69 70 74 |single s|ubscript|
|000047e0| 2e 0d 0d 45 76 65 72 79 | 20 64 61 74 61 20 74 79 |...Every| data ty|
|000047f0| 70 65 20 68 61 73 20 69 | 74 73 20 6f 77 6e 20 6e |pe has i|ts own n|
|00004800| 61 6d 65 73 70 61 63 65 | 2e 20 20 59 6f 75 20 63 |amespace|. You c|
|00004810| 61 6e 2c 20 77 69 74 68 | 6f 75 74 20 66 65 61 72 |an, with|out fear|
|00004820| 20 6f 66 0d 63 6f 6e 66 | 6c 69 63 74 2c 20 75 73 | of.conf|lict, us|
|00004830| 65 20 74 68 65 20 73 61 | 6d 65 20 6e 61 6d 65 20 |e the sa|me name |
|00004840| 66 6f 72 20 61 20 73 63 | 61 6c 61 72 20 76 61 72 |for a sc|alar var|
|00004850| 69 61 62 6c 65 2c 20 61 | 6e 20 61 72 72 61 79 2c |iable, a|n array,|
|00004860| 20 61 6e 0d 61 73 73 6f | 63 69 61 74 69 76 65 20 | an.asso|ciative |
|00004870| 61 72 72 61 79 2c 20 61 | 20 66 69 6c 65 68 61 6e |array, a| filehan|
|00004880| 64 6c 65 2c 20 61 20 73 | 75 62 72 6f 75 74 69 6e |dle, a s|ubroutin|
|00004890| 65 20 6e 61 6d 65 2c 20 | 61 6e 64 2f 6f 72 20 61 |e name, |and/or a|
|000048a0| 0d 6c 61 62 65 6c 2e 20 | 20 53 69 6e 63 65 20 76 |.label. | Since v|
|000048b0| 61 72 69 61 62 6c 65 20 | 61 6e 64 20 61 72 72 61 |ariable |and arra|
|000048c0| 79 20 72 65 66 65 72 65 | 6e 63 65 73 20 61 6c 77 |y refere|nces alw|
|000048d0| 61 79 73 20 73 74 61 72 | 74 20 77 69 74 68 0d 27 |ays star|t with.'|
|000048e0| 24 27 2c 20 27 40 27 2c | 20 6f 72 20 27 25 27 2c |$', '@',| or '%',|
|000048f0| 20 74 68 65 20 22 72 65 | 73 65 72 76 65 64 22 20 | the "re|served" |
|00004900| 77 6f 72 64 73 20 61 72 | 65 6e 27 74 20 69 6e 20 |words ar|en't in |
|00004910| 66 61 63 74 20 72 65 73 | 65 72 76 65 64 0d 77 69 |fact res|erved.wi|
|00004920| 74 68 20 72 65 73 70 65 | 63 74 20 74 6f 20 76 61 |th respe|ct to va|
|00004930| 72 69 61 62 6c 65 20 6e | 61 6d 65 73 2e 20 20 28 |riable n|ames. (|
|00004940| 54 68 65 79 20 41 52 45 | 20 72 65 73 65 72 76 65 |They ARE| reserve|
|00004950| 64 20 77 69 74 68 20 72 | 65 73 70 65 63 74 0d 74 |d with r|espect.t|
|00004960| 6f 20 6c 61 62 65 6c 73 | 20 61 6e 64 20 66 69 6c |o labels| and fil|
|00004970| 65 68 61 6e 64 6c 65 73 | 2c 20 68 6f 77 65 76 65 |ehandles|, howeve|
|00004980| 72 2c 20 77 68 69 63 68 | 20 64 6f 6e 27 74 20 68 |r, which| don't h|
|00004990| 61 76 65 20 61 6e 20 69 | 6e 69 74 69 61 6c 0d 73 |ave an i|nitial.s|
|000049a0| 70 65 63 69 61 6c 20 63 | 68 61 72 61 63 74 65 72 |pecial c|haracter|
|000049b0| 2e 20 20 48 69 6e 74 3a | 20 79 6f 75 20 63 6f 75 |. Hint:| you cou|
|000049c0| 6c 64 20 73 61 79 20 6f | 70 65 6e 28 4c 4f 47 2c |ld say o|pen(LOG,|
|000049d0| 27 6c 6f 67 66 69 6c 65 | 27 29 0d 72 61 74 68 65 |'logfile|').rathe|
|000049e0| 72 20 74 68 61 6e 20 6f | 70 65 6e 28 6c 6f 67 2c |r than o|pen(log,|
|000049f0| 27 6c 6f 67 66 69 6c 65 | 27 29 2e 20 20 55 73 69 |'logfile|'). Usi|
|00004a00| 6e 67 20 75 70 70 65 72 | 63 61 73 65 20 66 69 6c |ng upper|case fil|
|00004a10| 65 68 61 6e 64 6c 65 73 | 0d 61 6c 73 6f 20 69 6d |ehandles|.also im|
|00004a20| 70 72 6f 76 65 73 20 72 | 65 61 64 61 62 69 6c 69 |proves r|eadabili|
|00004a30| 74 79 20 61 6e 64 20 70 | 72 6f 74 65 63 74 73 20 |ty and p|rotects |
|00004a40| 79 6f 75 20 66 72 6f 6d | 20 63 6f 6e 66 6c 69 63 |you from| conflic|
|00004a50| 74 20 77 69 74 68 0d 66 | 75 74 75 72 65 20 72 65 |t with.f|uture re|
|00004a60| 73 65 72 76 65 64 20 77 | 6f 72 64 73 2e 29 20 43 |served w|ords.) C|
|00004a70| 61 73 65 20 49 53 20 73 | 69 67 6e 69 66 69 63 61 |ase IS s|ignifica|
|00004a80| 6e 74 2d 2d 22 46 4f 4f | 22 2c 20 22 46 6f 6f 22 |nt--"FOO|", "Foo"|
|00004a90| 20 61 6e 64 0d 22 66 6f | 6f 22 20 61 72 65 20 61 | and."fo|o" are a|
|00004aa0| 6c 6c 20 64 69 66 66 65 | 72 65 6e 74 20 6e 61 6d |ll diffe|rent nam|
|00004ab0| 65 73 2e 20 20 4e 61 6d | 65 73 20 77 68 69 63 68 |es. Nam|es which|
|00004ac0| 20 73 74 61 72 74 20 77 | 69 74 68 20 61 20 6c 65 | start w|ith a le|
|00004ad0| 74 74 65 72 0d 6d 61 79 | 20 61 6c 73 6f 20 63 6f |tter.may| also co|
|00004ae0| 6e 74 61 69 6e 20 64 69 | 67 69 74 73 20 61 6e 64 |ntain di|gits and|
|00004af0| 20 75 6e 64 65 72 73 63 | 6f 72 65 73 2e 20 20 4e | undersc|ores. N|
|00004b00| 61 6d 65 73 20 77 68 69 | 63 68 20 64 6f 20 6e 6f |ames whi|ch do no|
|00004b10| 74 0d 73 74 61 72 74 20 | 77 69 74 68 20 61 20 6c |t.start |with a l|
|00004b20| 65 74 74 65 72 20 61 72 | 65 20 6c 69 6d 69 74 65 |etter ar|e limite|
|00004b30| 64 20 74 6f 20 6f 6e 65 | 20 63 68 61 72 61 63 74 |d to one| charact|
|00004b40| 65 72 2c 20 65 2e 67 2e | 20 22 24 25 22 20 6f 72 |er, e.g.| "$%" or|
|00004b50| 0d 22 24 24 22 2e 20 20 | 28 4d 6f 73 74 20 6f 66 |."$$". |(Most of|
|00004b60| 20 74 68 65 20 6f 6e 65 | 20 63 68 61 72 61 63 74 | the one| charact|
|00004b70| 65 72 20 6e 61 6d 65 73 | 20 68 61 76 65 20 61 20 |er names| have a |
|00004b80| 70 72 65 64 65 66 69 6e | 65 64 20 73 69 67 6e 69 |predefin|ed signi|
|00004b90| 2d 0d 66 69 63 61 6e 63 | 65 20 74 6f 20 70 65 72 |-.ficanc|e to per|
|00004ba0| 6c 2e 20 20 4d 6f 72 65 | 20 6c 61 74 65 72 2e 29 |l. More| later.)|
|00004bb0| 0d 0d 4e 75 6d 65 72 69 | 63 20 6c 69 74 65 72 61 |..Numeri|c litera|
|00004bc0| 6c 73 20 61 72 65 20 73 | 70 65 63 69 66 69 65 64 |ls are s|pecified|
|00004bd0| 20 69 6e 20 61 6e 79 20 | 6f 66 20 74 68 65 20 75 | in any |of the u|
|00004be0| 73 75 61 6c 20 66 6c 6f | 61 74 69 6e 67 20 70 6f |sual flo|ating po|
|00004bf0| 69 6e 74 0d 6f 72 20 69 | 6e 74 65 67 65 72 20 66 |int.or i|nteger f|
|00004c00| 6f 72 6d 61 74 73 3a 0d | 0d 20 20 20 20 20 20 20 |ormats:.|. |
|00004c10| 20 20 20 31 32 33 34 35 | 0d 20 20 20 20 20 20 20 | 12345|. |
|00004c20| 20 20 20 31 32 33 34 35 | 2e 36 37 0d 20 20 20 20 | 12345|.67. |
|00004c30| 20 20 20 20 20 20 2e 32 | 33 45 2d 31 30 0d 20 20 | .2|3E-10. |
|00004c40| 20 20 20 20 20 20 20 20 | 30 78 66 66 66 66 20 20 | |0xffff |
|00004c50| 20 20 20 23 20 68 65 78 | 0d 20 20 20 20 20 20 20 | # hex|. |
|00004c60| 20 20 20 30 33 37 37 20 | 20 23 20 6f 63 74 61 6c | 0377 | # octal|
|00004c70| 0d 20 20 20 20 20 20 20 | 20 20 20 34 5f 32 39 34 |. | 4_294|
|00004c80| 5f 39 36 37 5f 32 39 36 | 0d 0d 53 74 72 69 6e 67 |_967_296|..String|
|00004c90| 20 6c 69 74 65 72 61 6c | 73 20 61 72 65 20 64 65 | literal|s are de|
|00004ca0| 6c 69 6d 69 74 65 64 20 | 62 79 20 65 69 74 68 65 |limited |by eithe|
|00004cb0| 72 20 73 69 6e 67 6c 65 | 20 6f 72 20 64 6f 75 62 |r single| or doub|
|00004cc0| 6c 65 20 71 75 6f 74 65 | 73 2e 0d 54 68 65 79 20 |le quote|s..They |
|00004cd0| 77 6f 72 6b 20 6d 75 63 | 68 20 6c 69 6b 65 20 73 |work muc|h like s|
|00004ce0| 68 65 6c 6c 20 71 75 6f | 74 65 73 3a 20 64 6f 75 |hell quo|tes: dou|
|00004cf0| 62 6c 65 2d 71 75 6f 74 | 65 64 20 73 74 72 69 6e |ble-quot|ed strin|
|00004d00| 67 20 6c 69 74 65 72 61 | 6c 73 0d 61 72 65 20 73 |g litera|ls.are s|
|00004d10| 75 62 6a 65 63 74 20 74 | 6f 20 62 61 63 6b 73 6c |ubject t|o backsl|
|00004d20| 61 73 68 20 61 6e 64 20 | 76 61 72 69 61 62 6c 65 |ash and |variable|
|00004d30| 20 73 75 62 73 74 69 74 | 75 74 69 6f 6e 3b 20 73 | substit|ution; s|
|00004d40| 69 6e 67 6c 65 2d 71 75 | 6f 74 65 64 0d 73 74 72 |ingle-qu|oted.str|
|00004d50| 69 6e 67 73 20 61 72 65 | 20 6e 6f 74 20 28 65 78 |ings are| not (ex|
|00004d60| 63 65 70 74 20 66 6f 72 | 20 5c 27 20 61 6e 64 20 |cept for| \' and |
|00004d70| 5c 5c 29 2e 20 20 54 68 | 65 20 75 73 75 61 6c 20 |\\). Th|e usual |
|00004d80| 62 61 63 6b 73 6c 61 73 | 68 0d 72 75 6c 65 73 20 |backslas|h.rules |
|00004d90| 61 70 70 6c 79 20 66 6f | 72 20 6d 61 6b 69 6e 67 |apply fo|r making|
|00004da0| 20 63 68 61 72 61 63 74 | 65 72 73 20 73 75 63 68 | charact|ers such|
|00004db0| 20 61 73 20 6e 65 77 6c | 69 6e 65 2c 20 74 61 62 | as newl|ine, tab|
|00004dc0| 2c 20 65 74 63 2e 2c 20 | 61 73 0d 77 65 6c 6c 20 |, etc., |as.well |
|00004dd0| 61 73 20 73 6f 6d 65 20 | 6d 6f 72 65 20 65 78 6f |as some |more exo|
|00004de0| 74 69 63 20 66 6f 72 6d | 73 3a 0d 0d 20 20 20 20 |tic form|s:.. |
|00004df0| 20 5c 74 20 20 20 20 20 | 20 20 20 74 61 62 0d 20 | \t | tab. |
|00004e00| 20 20 20 20 5c 6e 20 20 | 20 20 20 20 20 20 6e 65 | \n | ne|
|00004e10| 77 6c 69 6e 65 0d 20 20 | 20 20 20 5c 72 20 20 20 |wline. | \r |
|00004e20| 20 20 20 20 20 72 65 74 | 75 72 6e 0d 20 20 20 20 | ret|urn. |
|00004e30| 20 5c 66 20 20 20 20 20 | 20 20 20 66 6f 72 6d 20 | \f | form |
|00004e40| 66 65 65 64 0d 20 20 20 | 20 20 5c 62 20 20 20 20 |feed. | \b |
|00004e50| 20 20 20 20 62 61 63 6b | 73 70 61 63 65 0d 20 20 | back|space. |
|00004e60| 20 20 20 5c 61 20 20 20 | 20 20 20 20 20 61 6c 61 | \a | ala|
|00004e70| 72 6d 20 28 62 65 6c 6c | 29 0d 20 20 20 20 20 5c |rm (bell|). \|
|00004e80| 65 20 20 20 20 20 20 20 | 20 65 73 63 61 70 65 0d |e | escape.|
|00004e90| 20 20 20 20 20 5c 30 33 | 33 20 20 20 20 20 20 6f | \03|3 o|
|00004ea0| 63 74 61 6c 20 63 68 61 | 72 0d 20 20 20 20 20 5c |ctal cha|r. \|
|00004eb0| 78 31 62 20 20 20 20 20 | 20 68 65 78 20 63 68 61 |x1b | hex cha|
|00004ec0| 72 0d 20 20 20 20 20 5c | 63 5b 20 20 20 20 20 20 |r. \|c[ |
|00004ed0| 20 63 6f 6e 74 72 6f 6c | 20 63 68 61 72 0d 20 20 | control| char. |
|00004ee0| 20 20 20 5c 6c 20 20 20 | 20 20 20 20 20 6c 6f 77 | \l | low|
|00004ef0| 65 72 63 61 73 65 20 6e | 65 78 74 20 63 68 61 72 |ercase n|ext char|
|00004f00| 0d 20 20 20 20 20 5c 75 | 20 20 20 20 20 20 20 20 |. \u| |
|00004f10| 75 70 70 65 72 63 61 73 | 65 20 6e 65 78 74 20 63 |uppercas|e next c|
|00004f20| 68 61 72 0d 20 20 20 20 | 20 5c 4c 20 20 20 20 20 |har. | \L |
|00004f30| 20 20 20 6c 6f 77 65 72 | 63 61 73 65 20 74 69 6c | lower|case til|
|00004f40| 6c 20 5c 45 0d 20 20 20 | 20 20 5c 55 20 20 20 20 |l \E. | \U |
|00004f50| 20 20 20 20 75 70 70 65 | 72 63 61 73 65 20 74 69 | uppe|rcase ti|
|00004f60| 6c 6c 20 5c 45 0d 20 20 | 20 20 20 5c 45 20 20 20 |ll \E. | \E |
|00004f70| 20 20 20 20 20 65 6e 64 | 20 63 61 73 65 20 6d 6f | end| case mo|
|00004f80| 64 69 66 69 63 61 74 69 | 6f 6e 0d 0d 59 6f 75 20 |dificati|on..You |
|00004f90| 63 61 6e 20 61 6c 73 6f | 20 65 6d 62 65 64 20 6e |can also| embed n|
|00004fa0| 65 77 6c 69 6e 65 73 20 | 64 69 72 65 63 74 6c 79 |ewlines |directly|
|00004fb0| 20 69 6e 20 79 6f 75 72 | 20 73 74 72 69 6e 67 73 | in your| strings|
|00004fc0| 2c 20 69 2e 65 2e 20 74 | 68 65 79 0d 63 61 6e 20 |, i.e. t|hey.can |
|00004fd0| 65 6e 64 20 6f 6e 20 61 | 20 64 69 66 66 65 72 65 |end on a| differe|
|00004fe0| 6e 74 20 6c 69 6e 65 20 | 74 68 61 6e 20 74 68 65 |nt line |than the|
|00004ff0| 79 20 62 65 67 69 6e 2e | 20 20 54 68 69 73 20 69 |y begin.| This i|
|00005000| 73 20 6e 69 63 65 2c 20 | 62 75 74 0d 69 66 20 79 |s nice, |but.if y|
|00005010| 6f 75 20 66 6f 72 67 65 | 74 20 79 6f 75 72 20 74 |ou forge|t your t|
|00005020| 72 61 69 6c 69 6e 67 20 | 71 75 6f 74 65 2c 20 74 |railing |quote, t|
|00005030| 68 65 20 65 72 72 6f 72 | 20 77 69 6c 6c 20 6e 6f |he error| will no|
|00005040| 74 20 62 65 20 72 65 70 | 6f 72 74 65 64 0d 75 6e |t be rep|orted.un|
|00005050| 74 69 6c 20 70 65 72 6c | 20 66 69 6e 64 73 20 61 |til perl| finds a|
|00005060| 6e 6f 74 68 65 72 20 6c | 69 6e 65 20 63 6f 6e 74 |nother l|ine cont|
|00005070| 61 69 6e 69 6e 67 20 74 | 68 65 20 71 75 6f 74 65 |aining t|he quote|
|00005080| 20 63 68 61 72 61 63 74 | 65 72 2c 0d 77 68 69 63 | charact|er,.whic|
|00005090| 68 20 6d 61 79 20 62 65 | 20 6d 75 63 68 20 66 75 |h may be| much fu|
|000050a0| 72 74 68 65 72 20 6f 6e | 20 69 6e 20 74 68 65 20 |rther on| in the |
|000050b0| 73 63 72 69 70 74 2e 20 | 20 56 61 72 69 61 62 6c |script. | Variabl|
|000050c0| 65 20 73 75 62 73 74 69 | 74 75 2d 0d 74 69 6f 6e |e substi|tu-.tion|
|000050d0| 20 69 6e 73 69 64 65 20 | 73 74 72 69 6e 67 73 20 | inside |strings |
|000050e0| 69 73 20 6c 69 6d 69 74 | 65 64 20 74 6f 20 73 63 |is limit|ed to sc|
|000050f0| 61 6c 61 72 20 76 61 72 | 69 61 62 6c 65 73 2c 20 |alar var|iables, |
|00005100| 6e 6f 72 6d 61 6c 20 61 | 72 72 61 79 0d 76 61 6c |normal a|rray.val|
|00005110| 75 65 73 2c 20 61 6e 64 | 20 61 72 72 61 79 20 73 |ues, and| array s|
|00005120| 6c 69 63 65 73 2e 20 20 | 28 49 6e 20 6f 74 68 65 |lices. |(In othe|
|00005130| 72 20 77 6f 72 64 73 2c | 20 69 64 65 6e 74 69 66 |r words,| identif|
|00005140| 69 65 72 73 20 62 65 67 | 69 6e 6e 69 6e 67 0d 77 |iers beg|inning.w|
|00005150| 69 74 68 20 24 20 6f 72 | 20 40 2c 20 66 6f 6c 6c |ith $ or| @, foll|
|00005160| 6f 77 65 64 20 62 79 20 | 61 6e 20 6f 70 74 69 6f |owed by |an optio|
|00005170| 6e 61 6c 20 62 72 61 63 | 6b 65 74 65 64 20 65 78 |nal brac|keted ex|
|00005180| 70 72 65 73 73 69 6f 6e | 20 61 73 20 61 0d 73 75 |pression| as a.su|
|00005190| 62 73 63 72 69 70 74 2e | 29 20 54 68 65 20 66 6f |bscript.|) The fo|
|000051a0| 6c 6c 6f 77 69 6e 67 20 | 63 6f 64 65 20 73 65 67 |llowing |code seg|
|000051b0| 6d 65 6e 74 20 70 72 69 | 6e 74 73 20 6f 75 74 20 |ment pri|nts out |
|000051c0| 22 54 68 65 20 70 72 69 | 63 65 20 69 73 0d 24 31 |"The pri|ce is.$1|
|000051d0| 30 30 2e 22 0d 0d 20 20 | 20 20 20 20 20 20 20 20 |00.".. | |
|000051e0| 24 50 72 69 63 65 20 3d | 20 27 24 31 30 30 27 3b |$Price =| '$100';|
|000051f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 23 | | #|
|00005200| 20 6e 6f 74 20 69 6e 74 | 65 72 70 72 65 74 65 64 | not int|erpreted|
|00005210| 0d 20 20 20 20 20 20 20 | 20 20 20 70 72 69 6e 74 |. | print|
|00005220| 20 22 54 68 65 20 70 72 | 69 63 65 20 69 73 20 24 | "The pr|ice is $|
|00005230| 50 72 69 63 65 2e 5c 6e | 22 3b 23 20 69 6e 74 65 |Price.\n|";# inte|
|00005240| 72 70 72 65 74 65 64 0d | 0d 4e 6f 74 65 20 74 68 |rpreted.|.Note th|
|00005250| 61 74 20 79 6f 75 20 63 | 61 6e 20 70 75 74 20 63 |at you c|an put c|
|00005260| 75 72 6c 79 20 62 72 61 | 63 6b 65 74 73 20 61 72 |urly bra|ckets ar|
|00005270| 6f 75 6e 64 20 74 68 65 | 20 69 64 65 6e 74 69 66 |ound the| identif|
|00005280| 69 65 72 20 74 6f 0d 64 | 65 6c 69 6d 69 74 20 69 |ier to.d|elimit i|
|00005290| 74 20 66 72 6f 6d 20 66 | 6f 6c 6c 6f 77 69 6e 67 |t from f|ollowing|
|000052a0| 20 61 6c 70 68 61 6e 75 | 6d 65 72 69 63 73 2e 20 | alphanu|merics. |
|000052b0| 20 41 6c 73 6f 20 6e 6f | 74 65 20 74 68 61 74 20 | Also no|te that |
|000052c0| 61 20 73 69 6e 67 6c 65 | 0d 71 75 6f 74 65 64 20 |a single|.quoted |
|000052d0| 73 74 72 69 6e 67 20 6d | 75 73 74 20 62 65 20 73 |string m|ust be s|
|000052e0| 65 70 61 72 61 74 65 64 | 20 66 72 6f 6d 20 61 20 |eparated| from a |
|000052f0| 70 72 65 63 65 64 69 6e | 67 20 77 6f 72 64 20 62 |precedin|g word b|
|00005300| 79 20 61 20 73 70 61 63 | 65 2c 0d 73 69 6e 63 65 |y a spac|e,.since|
|00005310| 20 73 69 6e 67 6c 65 20 | 71 75 6f 74 65 20 69 73 | single |quote is|
|00005320| 20 61 20 76 61 6c 69 64 | 20 63 68 61 72 61 63 74 | a valid| charact|
|00005330| 65 72 20 69 6e 20 61 6e | 20 69 64 65 6e 74 69 66 |er in an| identif|
|00005340| 69 65 72 20 28 73 65 65 | 0d 50 61 63 6b 61 67 65 |ier (see|.Package|
|00005350| 73 29 2e 0d 0d 54 77 6f | 20 73 70 65 63 69 61 6c |s)...Two| special|
|00005360| 20 6c 69 74 65 72 61 6c | 73 20 61 72 65 20 5f 5f | literal|s are __|
|00005370| 4c 49 4e 45 5f 5f 20 61 | 6e 64 20 5f 5f 46 49 4c |LINE__ a|nd __FIL|
|00005380| 45 5f 5f 2c 20 77 68 69 | 63 68 20 72 65 70 72 65 |E__, whi|ch repre|
|00005390| 73 65 6e 74 0d 74 68 65 | 20 63 75 72 72 65 6e 74 |sent.the| current|
|000053a0| 20 6c 69 6e 65 20 6e 75 | 6d 62 65 72 20 61 6e 64 | line nu|mber and|
|000053b0| 20 66 69 6c 65 6e 61 6d | 65 20 61 74 20 74 68 61 | filenam|e at tha|
|000053c0| 74 20 70 6f 69 6e 74 20 | 69 6e 20 79 6f 75 72 20 |t point |in your |
|000053d0| 70 72 6f 2d 0d 67 72 61 | 6d 2e 20 20 54 68 65 79 |pro-.gra|m. They|
|000053e0| 20 6d 61 79 20 6f 6e 6c | 79 20 62 65 20 75 73 65 | may onl|y be use|
|000053f0| 64 20 61 73 20 73 65 70 | 61 72 61 74 65 20 74 6f |d as sep|arate to|
|00005400| 6b 65 6e 73 3b 20 74 68 | 65 79 20 77 69 6c 6c 20 |kens; th|ey will |
|00005410| 6e 6f 74 20 62 65 0d 69 | 6e 74 65 72 70 6f 6c 61 |not be.i|nterpola|
|00005420| 74 65 64 20 69 6e 74 6f | 20 73 74 72 69 6e 67 73 |ted into| strings|
|00005430| 2e 20 20 49 6e 20 61 64 | 64 69 74 69 6f 6e 2c 20 |. In ad|dition, |
|00005440| 74 68 65 20 74 6f 6b 65 | 6e 20 5f 5f 45 4e 44 5f |the toke|n __END_|
|00005450| 5f 20 6d 61 79 20 62 65 | 0d 75 73 65 64 20 74 6f |_ may be|.used to|
|00005460| 20 69 6e 64 69 63 61 74 | 65 20 74 68 65 20 6c 6f | indicat|e the lo|
|00005470| 67 69 63 61 6c 20 65 6e | 64 20 6f 66 20 74 68 65 |gical en|d of the|
|00005480| 20 73 63 72 69 70 74 20 | 62 65 66 6f 72 65 20 74 | script |before t|
|00005490| 68 65 20 61 63 74 75 61 | 6c 0d 65 6e 64 20 6f 66 |he actua|l.end of|
|000054a0| 20 66 69 6c 65 2e 20 20 | 41 6e 79 20 66 6f 6c 6c | file. |Any foll|
|000054b0| 6f 77 69 6e 67 20 74 65 | 78 74 20 69 73 20 69 67 |owing te|xt is ig|
|000054c0| 6e 6f 72 65 64 2c 20 62 | 75 74 20 6d 61 79 20 62 |nored, b|ut may b|
|000054d0| 65 20 72 65 61 64 20 76 | 69 61 20 0d 74 68 65 20 |e read v|ia .the |
|000054e0| 44 41 54 41 20 66 69 6c | 65 68 61 6e 64 6c 65 2e |DATA fil|ehandle.|
|000054f0| 20 28 54 68 65 20 44 41 | 54 41 20 66 69 6c 65 68 | (The DA|TA fileh|
|00005500| 61 6e 64 6c 65 20 6d 61 | 79 20 72 65 61 64 20 64 |andle ma|y read d|
|00005510| 61 74 61 20 6f 6e 6c 79 | 20 66 72 6f 6d 20 0d 74 |ata only| from .t|
|00005520| 68 65 20 6d 61 69 6e 20 | 73 63 72 69 70 74 2c 20 |he main |script, |
|00005530| 62 75 74 20 6e 6f 74 20 | 66 72 6f 6d 20 61 6e 79 |but not |from any|
|00005540| 20 72 65 71 75 69 72 65 | 64 20 66 69 6c 65 20 6f | require|d file o|
|00005550| 72 20 65 76 61 6c 75 61 | 74 65 64 20 73 74 72 69 |r evalua|ted stri|
|00005560| 6e 67 2e 29 20 20 0d 54 | 68 65 20 74 77 6f 20 63 |ng.) .T|he two c|
|00005570| 6f 6e 74 72 6f 6c 20 63 | 68 61 72 61 63 74 65 72 |ontrol c|haracter|
|00005580| 73 20 5e 44 20 61 6e 64 | 20 5e 5a 20 61 72 65 20 |s ^D and| ^Z are |
|00005590| 73 79 6e 6f 6e 79 6d 73 | 20 66 6f 72 20 5f 5f 45 |synonyms| for __E|
|000055a0| 4e 44 5f 5f 2e 0d 0d 41 | 20 77 6f 72 64 20 74 68 |ND__...A| word th|
|000055b0| 61 74 20 64 6f 65 73 6e | 27 74 20 68 61 76 65 20 |at doesn|'t have |
|000055c0| 61 6e 79 20 6f 74 68 65 | 72 20 69 6e 74 65 72 70 |any othe|r interp|
|000055d0| 72 65 74 61 74 69 6f 6e | 20 69 6e 20 74 68 65 20 |retation| in the |
|000055e0| 67 72 61 6d 6d 61 72 0d | 77 69 6c 6c 20 62 65 20 |grammar.|will be |
|000055f0| 74 72 65 61 74 65 64 20 | 61 73 20 69 66 20 69 74 |treated |as if it|
|00005600| 20 68 61 64 20 73 69 6e | 67 6c 65 20 71 75 6f 74 | had sin|gle quot|
|00005610| 65 73 20 61 72 6f 75 6e | 64 20 69 74 2e 20 20 46 |es aroun|d it. F|
|00005620| 6f 72 20 74 68 69 73 0d | 70 75 72 70 6f 73 65 2c |or this.|purpose,|
|00005630| 20 61 20 77 6f 72 64 20 | 63 6f 6e 73 69 73 74 73 | a word |consists|
|00005640| 20 6f 6e 6c 79 20 6f 66 | 20 61 6c 70 68 61 6e 75 | only of| alphanu|
|00005650| 6d 65 72 69 63 20 63 68 | 61 72 61 63 74 65 72 73 |meric ch|aracters|
|00005660| 20 61 6e 64 0d 75 6e 64 | 65 72 6c 69 6e 65 2c 20 | and.und|erline, |
|00005670| 61 6e 64 20 6d 75 73 74 | 20 73 74 61 72 74 20 77 |and must| start w|
|00005680| 69 74 68 20 61 6e 20 61 | 6c 70 68 61 62 65 74 69 |ith an a|lphabeti|
|00005690| 63 20 63 68 61 72 61 63 | 74 65 72 2e 20 20 41 73 |c charac|ter. As|
|000056a0| 20 77 69 74 68 0d 66 69 | 6c 65 68 61 6e 64 6c 65 | with.fi|lehandle|
|000056b0| 73 20 61 6e 64 20 6c 61 | 62 65 6c 73 2c 20 61 20 |s and la|bels, a |
|000056c0| 62 61 72 65 20 77 6f 72 | 64 20 74 68 61 74 20 63 |bare wor|d that c|
|000056d0| 6f 6e 73 69 73 74 73 20 | 65 6e 74 69 72 65 6c 79 |onsists |entirely|
|000056e0| 20 6f 66 0d 6c 6f 77 65 | 72 63 61 73 65 20 6c 65 | of.lowe|rcase le|
|000056f0| 74 74 65 72 73 20 72 69 | 73 6b 73 20 63 6f 6e 66 |tters ri|sks conf|
|00005700| 6c 69 63 74 20 77 69 74 | 68 20 66 75 74 75 72 65 |lict wit|h future|
|00005710| 20 72 65 73 65 72 76 65 | 64 20 77 6f 72 64 73 2c | reserve|d words,|
|00005720| 20 61 6e 64 0d 69 66 20 | 79 6f 75 20 75 73 65 20 | and.if |you use |
|00005730| 74 68 65 20 2d 77 20 73 | 77 69 74 63 68 2c 20 50 |the -w s|witch, P|
|00005740| 65 72 6c 20 77 69 6c 6c | 20 77 61 72 6e 20 79 6f |erl will| warn yo|
|00005750| 75 20 61 62 6f 75 74 20 | 61 6e 79 20 73 75 63 68 |u about |any such|
|00005760| 0d 77 6f 72 64 73 2e 0d | 0d 41 72 72 61 79 20 76 |.words..|.Array v|
|00005770| 61 6c 75 65 73 20 61 72 | 65 20 69 6e 74 65 72 70 |alues ar|e interp|
|00005780| 6f 6c 61 74 65 64 20 69 | 6e 74 6f 20 64 6f 75 62 |olated i|nto doub|
|00005790| 6c 65 2d 71 75 6f 74 65 | 64 20 73 74 72 69 6e 67 |le-quote|d string|
|000057a0| 73 20 62 79 20 6a 6f 69 | 6e 2d 0d 69 6e 67 20 61 |s by joi|n-.ing a|
|000057b0| 6c 6c 20 74 68 65 20 65 | 6c 65 6d 65 6e 74 73 20 |ll the e|lements |
|000057c0| 6f 66 20 74 68 65 20 61 | 72 72 61 79 20 77 69 74 |of the a|rray wit|
|000057d0| 68 20 74 68 65 20 64 65 | 6c 69 6d 69 74 65 72 20 |h the de|limiter |
|000057e0| 73 70 65 63 69 66 69 65 | 64 20 69 6e 0d 74 68 65 |specifie|d in.the|
|000057f0| 20 24 22 20 76 61 72 69 | 61 62 6c 65 2c 20 73 70 | $" vari|able, sp|
|00005800| 61 63 65 20 62 79 20 64 | 65 66 61 75 6c 74 2e 20 |ace by d|efault. |
|00005810| 20 28 53 69 6e 63 65 20 | 69 6e 20 76 65 72 73 69 | (Since |in versi|
|00005820| 6f 6e 73 20 6f 66 20 70 | 65 72 6c 0d 70 72 69 6f |ons of p|erl.prio|
|00005830| 72 20 74 6f 20 33 2e 30 | 20 74 68 65 20 40 20 63 |r to 3.0| the @ c|
|00005840| 68 61 72 61 63 74 65 72 | 20 77 61 73 20 6e 6f 74 |haracter| was not|
|00005850| 20 61 20 6d 65 74 61 63 | 68 61 72 61 63 74 65 72 | a metac|haracter|
|00005860| 20 69 6e 20 64 6f 75 62 | 6c 65 2d 0d 71 75 6f 74 | in doub|le-.quot|
|00005870| 65 64 20 73 74 72 69 6e | 67 73 2c 20 74 68 65 20 |ed strin|gs, the |
|00005880| 69 6e 74 65 72 70 6f 6c | 61 74 69 6f 6e 20 6f 66 |interpol|ation of|
|00005890| 20 40 61 72 72 61 79 2c | 20 24 61 72 72 61 79 5b | @array,| $array[|
|000058a0| 45 58 50 52 5d 2c 0d 40 | 61 72 72 61 79 5b 4c 49 |EXPR],.@|array[LI|
|000058b0| 53 54 5d 2c 20 24 61 72 | 72 61 79 7b 45 58 50 52 |ST], $ar|ray{EXPR|
|000058c0| 7d 2c 20 6f 72 20 40 61 | 72 72 61 79 7b 4c 49 53 |}, or @a|rray{LIS|
|000058d0| 54 7d 20 6f 6e 6c 79 20 | 68 61 70 70 65 6e 73 20 |T} only |happens |
|000058e0| 69 66 20 61 72 72 61 79 | 0d 69 73 20 72 65 66 65 |if array|.is refe|
|000058f0| 72 65 6e 63 65 64 20 65 | 6c 73 65 77 68 65 72 65 |renced e|lsewhere|
|00005900| 20 69 6e 20 74 68 65 20 | 70 72 6f 67 72 61 6d 20 | in the |program |
|00005910| 6f 72 20 69 73 20 70 72 | 65 64 65 66 69 6e 65 64 |or is pr|edefined|
|00005920| 2e 29 20 54 68 65 0d 66 | 6f 6c 6c 6f 77 69 6e 67 |.) The.f|ollowing|
|00005930| 20 61 72 65 20 65 71 75 | 69 76 61 6c 65 6e 74 3a | are equ|ivalent:|
|00005940| 0d 0d 20 20 20 20 20 24 | 74 65 6d 70 20 3d 20 6a |.. $|temp = j|
|00005950| 6f 69 6e 28 24 22 2c 40 | 41 52 47 56 29 3b 0d 20 |oin($",@|ARGV);. |
|00005960| 20 20 20 20 73 79 73 74 | 65 6d 20 22 65 63 68 6f | syst|em "echo|
|00005970| 20 24 74 65 6d 70 22 3b | 0d 0d 20 20 20 20 20 73 | $temp";|.. s|
|00005980| 79 73 74 65 6d 20 22 65 | 63 68 6f 20 40 41 52 47 |ystem "e|cho @ARG|
|00005990| 56 22 3b 0d 0d 0d 57 69 | 74 68 69 6e 20 73 65 61 |V";...Wi|thin sea|
|000059a0| 72 63 68 20 70 61 74 74 | 65 72 6e 73 20 28 77 68 |rch patt|erns (wh|
|000059b0| 69 63 68 20 61 6c 73 6f | 20 75 6e 64 65 72 67 6f |ich also| undergo|
|000059c0| 20 64 6f 75 62 6c 65 2d | 71 75 6f 74 69 73 68 20 | double-|quotish |
|000059d0| 73 75 62 73 74 69 2d 0d | 74 75 74 69 6f 6e 29 20 |substi-.|tution) |
|000059e0| 74 68 65 72 65 20 69 73 | 20 61 20 62 61 64 20 61 |there is| a bad a|
|000059f0| 6d 62 69 67 75 69 74 79 | 3a 20 20 49 73 20 2f 24 |mbiguity|: Is /$|
|00005a00| 66 6f 6f 5b 62 61 72 5d | 2f 20 74 6f 20 62 65 20 |foo[bar]|/ to be |
|00005a10| 69 6e 74 65 72 2d 0d 70 | 72 65 74 65 64 20 61 73 |inter-.p|reted as|
|00005a20| 20 2f 24 7b 66 6f 6f 7d | 5b 62 61 72 5d 2f 20 28 | /${foo}|[bar]/ (|
|00005a30| 77 68 65 72 65 20 5b 62 | 61 72 5d 20 69 73 20 61 |where [b|ar] is a|
|00005a40| 20 63 68 61 72 61 63 74 | 65 72 20 63 6c 61 73 73 | charact|er class|
|00005a50| 20 66 6f 72 20 74 68 65 | 0d 72 65 67 75 6c 61 72 | for the|.regular|
|00005a60| 20 65 78 70 72 65 73 73 | 69 6f 6e 29 20 6f 72 20 | express|ion) or |
|00005a70| 61 73 20 2f 24 7b 66 6f | 6f 5b 62 61 72 5d 7d 2f |as /${fo|o[bar]}/|
|00005a80| 20 28 77 68 65 72 65 20 | 5b 62 61 72 5d 20 69 73 | (where |[bar] is|
|00005a90| 20 74 68 65 20 73 75 62 | 2d 0d 73 63 72 69 70 74 | the sub|-.script|
|00005aa0| 20 74 6f 20 61 72 72 61 | 79 20 40 66 6f 6f 29 3f | to arra|y @foo)?|
|00005ab0| 20 20 49 66 20 40 66 6f | 6f 20 64 6f 65 73 6e 27 | If @fo|o doesn'|
|00005ac0| 74 20 6f 74 68 65 72 77 | 69 73 65 20 65 78 69 73 |t otherw|ise exis|
|00005ad0| 74 2c 20 74 68 65 6e 0d | 69 74 27 73 20 6f 62 76 |t, then.|it's obv|
|00005ae0| 69 6f 75 73 6c 79 20 61 | 20 63 68 61 72 61 63 74 |iously a| charact|
|00005af0| 65 72 20 63 6c 61 73 73 | 2e 20 20 49 66 20 40 66 |er class|. If @f|
|00005b00| 6f 6f 20 65 78 69 73 74 | 73 2c 20 70 65 72 6c 20 |oo exist|s, perl |
|00005b10| 74 61 6b 65 73 20 61 0d | 67 6f 6f 64 20 67 75 65 |takes a.|good gue|
|00005b20| 73 73 20 61 62 6f 75 74 | 20 5b 62 61 72 5d 2c 20 |ss about| [bar], |
|00005b30| 61 6e 64 20 69 73 20 61 | 6c 6d 6f 73 74 20 61 6c |and is a|lmost al|
|00005b40| 77 61 79 73 20 72 69 67 | 68 74 2e 20 20 49 66 20 |ways rig|ht. If |
|00005b50| 69 74 20 64 6f 65 73 0d | 67 75 65 73 73 20 77 72 |it does.|guess wr|
|00005b60| 6f 6e 67 2c 20 6f 72 20 | 69 66 20 79 6f 75 27 72 |ong, or |if you'r|
|00005b70| 65 20 6a 75 73 74 20 70 | 6c 61 69 6e 20 70 61 72 |e just p|lain par|
|00005b80| 61 6e 6f 69 64 2c 20 79 | 6f 75 20 63 61 6e 20 66 |anoid, y|ou can f|
|00005b90| 6f 72 63 65 20 74 68 65 | 0d 63 6f 72 72 65 63 74 |orce the|.correct|
|00005ba0| 20 69 6e 74 65 72 70 72 | 65 74 61 74 69 6f 6e 20 | interpr|etation |
|00005bb0| 77 69 74 68 20 63 75 72 | 6c 79 20 62 72 61 63 6b |with cur|ly brack|
|00005bc0| 65 74 73 20 61 73 20 61 | 62 6f 76 65 2e 0d 0d 41 |ets as a|bove...A|
|00005bd0| 20 6c 69 6e 65 2d 6f 72 | 69 65 6e 74 65 64 20 66 | line-or|iented f|
|00005be0| 6f 72 6d 20 6f 66 20 71 | 75 6f 74 69 6e 67 20 69 |orm of q|uoting i|
|00005bf0| 73 20 62 61 73 65 64 20 | 6f 6e 20 74 68 65 20 73 |s based |on the s|
|00005c00| 68 65 6c 6c 20 68 65 72 | 65 2d 69 73 0d 73 79 6e |hell her|e-is.syn|
|00005c10| 74 61 78 2e 20 20 46 6f | 6c 6c 6f 77 69 6e 67 20 |tax. Fo|llowing |
|00005c20| 61 20 3c 3c 20 79 6f 75 | 20 73 70 65 63 69 66 79 |a << you| specify|
|00005c30| 20 61 20 73 74 72 69 6e | 67 20 74 6f 20 74 65 72 | a strin|g to ter|
|00005c40| 6d 69 6e 61 74 65 20 74 | 68 65 0d 71 75 6f 74 65 |minate t|he.quote|
|00005c50| 64 20 6d 61 74 65 72 69 | 61 6c 2c 20 61 6e 64 20 |d materi|al, and |
|00005c60| 61 6c 6c 20 6c 69 6e 65 | 73 20 66 6f 6c 6c 6f 77 |all line|s follow|
|00005c70| 69 6e 67 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 |ing the |current |
|00005c80| 6c 69 6e 65 20 64 6f 77 | 6e 20 74 6f 0d 74 68 65 |line dow|n to.the|
|00005c90| 20 74 65 72 6d 69 6e 61 | 74 69 6e 67 20 73 74 72 | termina|ting str|
|00005ca0| 69 6e 67 20 61 72 65 20 | 74 68 65 20 76 61 6c 75 |ing are |the valu|
|00005cb0| 65 20 6f 66 20 74 68 65 | 20 69 74 65 6d 2e 20 20 |e of the| item. |
|00005cc0| 54 68 65 20 74 65 72 6d | 69 6e 61 74 2d 0d 69 6e |The term|inat-.in|
|00005cd0| 67 20 73 74 72 69 6e 67 | 20 6d 61 79 20 62 65 20 |g string| may be |
|00005ce0| 65 69 74 68 65 72 20 61 | 6e 20 69 64 65 6e 74 69 |either a|n identi|
|00005cf0| 66 69 65 72 20 28 61 20 | 77 6f 72 64 29 2c 20 6f |fier (a |word), o|
|00005d00| 72 20 73 6f 6d 65 20 71 | 75 6f 74 65 64 0d 74 65 |r some q|uoted.te|
|00005d10| 78 74 2e 20 20 49 66 20 | 71 75 6f 74 65 64 2c 20 |xt. If |quoted, |
|00005d20| 74 68 65 20 74 79 70 65 | 20 6f 66 20 71 75 6f 74 |the type| of quot|
|00005d30| 65 73 20 79 6f 75 20 75 | 73 65 20 64 65 74 65 72 |es you u|se deter|
|00005d40| 6d 69 6e 65 73 20 74 68 | 65 0d 74 72 65 61 74 6d |mines th|e.treatm|
|00005d50| 65 6e 74 20 6f 66 20 74 | 68 65 20 74 65 78 74 2c |ent of t|he text,|
|00005d60| 20 6a 75 73 74 20 61 73 | 20 69 6e 20 72 65 67 75 | just as| in regu|
|00005d70| 6c 61 72 20 71 75 6f 74 | 69 6e 67 2e 20 20 41 6e |lar quot|ing. An|
|00005d80| 20 75 6e 71 75 6f 74 65 | 64 0d 69 64 65 6e 74 69 | unquote|d.identi|
|00005d90| 66 69 65 72 20 77 6f 72 | 6b 73 20 6c 69 6b 65 20 |fier wor|ks like |
|00005da0| 64 6f 75 62 6c 65 20 71 | 75 6f 74 65 73 2e 20 20 |double q|uotes. |
|00005db0| 54 68 65 72 65 20 6d 75 | 73 74 20 62 65 20 6e 6f |There mu|st be no|
|00005dc0| 20 73 70 61 63 65 0d 62 | 65 74 77 65 65 6e 20 74 | space.b|etween t|
|00005dd0| 68 65 20 3c 3c 20 61 6e | 64 20 74 68 65 20 69 64 |he << an|d the id|
|00005de0| 65 6e 74 69 66 69 65 72 | 2e 20 20 28 49 66 20 79 |entifier|. (If y|
|00005df0| 6f 75 20 70 75 74 20 61 | 20 73 70 61 63 65 20 69 |ou put a| space i|
|00005e00| 74 20 77 69 6c 6c 0d 62 | 65 20 74 72 65 61 74 65 |t will.b|e treate|
|00005e10| 64 20 61 73 20 61 20 6e | 75 6c 6c 20 69 64 65 6e |d as a n|ull iden|
|00005e20| 74 69 66 69 65 72 2c 20 | 77 68 69 63 68 20 69 73 |tifier, |which is|
|00005e30| 20 76 61 6c 69 64 2c 20 | 61 6e 64 20 6d 61 74 63 | valid, |and matc|
|00005e40| 68 65 73 20 74 68 65 0d | 66 69 72 73 74 20 62 6c |hes the.|first bl|
|00005e50| 61 6e 6b 20 6c 69 6e 65 | 2d 2d 73 65 65 20 4d 65 |ank line|--see Me|
|00005e60| 72 72 79 20 43 68 72 69 | 73 74 6d 61 73 20 65 78 |rry Chri|stmas ex|
|00005e70| 61 6d 70 6c 65 20 62 65 | 6c 6f 77 2e 29 20 54 68 |ample be|low.) Th|
|00005e80| 65 20 74 65 72 2d 0d 6d | 69 6e 61 74 69 6e 67 20 |e ter-.m|inating |
|00005e90| 73 74 72 69 6e 67 20 6d | 75 73 74 20 61 70 70 65 |string m|ust appe|
|00005ea0| 61 72 20 62 79 20 69 74 | 73 65 6c 66 20 28 75 6e |ar by it|self (un|
|00005eb0| 71 75 6f 74 65 64 20 61 | 6e 64 20 77 69 74 68 20 |quoted a|nd with |
|00005ec0| 6e 6f 20 73 75 72 2d 0d | 72 6f 75 6e 64 69 6e 67 |no sur-.|rounding|
|00005ed0| 20 77 68 69 74 65 73 70 | 61 63 65 29 20 6f 6e 20 | whitesp|ace) on |
|00005ee0| 74 68 65 20 74 65 72 6d | 69 6e 61 74 69 6e 67 20 |the term|inating |
|00005ef0| 6c 69 6e 65 2e 0d 0d 70 | 72 69 6e 74 20 3c 3c 45 |line...p|rint <<E|
|00005f00| 4f 46 3b 20 20 20 20 20 | 20 20 20 23 20 73 61 6d |OF; | # sam|
|00005f10| 65 20 61 73 20 61 62 6f | 76 65 0d 54 68 65 20 70 |e as abo|ve.The p|
|00005f20| 72 69 63 65 20 69 73 20 | 24 50 72 69 63 65 2e 0d |rice is |$Price..|
|00005f30| 45 4f 46 0d 0d 70 72 69 | 6e 74 20 3c 3c 22 45 4f |EOF..pri|nt <<"EO|
|00005f40| 46 22 3b 20 20 20 20 20 | 20 23 20 73 61 6d 65 20 |F"; | # same |
|00005f50| 61 73 20 61 62 6f 76 65 | 0d 54 68 65 20 70 72 69 |as above|.The pri|
|00005f60| 63 65 20 69 73 20 24 50 | 72 69 63 65 2e 0d 45 4f |ce is $P|rice..EO|
|00005f70| 46 0d 0d 70 72 69 6e 74 | 20 3c 3c 20 78 20 31 30 |F..print| << x 10|
|00005f80| 3b 20 20 20 20 20 20 23 | 20 6e 75 6c 6c 20 69 64 |; #| null id|
|00005f90| 65 6e 74 69 66 69 65 72 | 20 69 73 20 64 65 6c 69 |entifier| is deli|
|00005fa0| 6d 69 74 65 72 0d 4d 65 | 72 72 79 20 43 68 72 69 |miter.Me|rry Chri|
|00005fb0| 73 74 6d 61 73 21 0d 0d | 70 72 69 6e 74 20 3c 3c |stmas!..|print <<|
|00005fc0| 60 45 4f 43 60 3b 20 20 | 20 20 20 20 23 20 65 78 |`EOC`; | # ex|
|00005fd0| 65 63 75 74 65 20 63 6f | 6d 6d 61 6e 64 73 0d 65 |ecute co|mmands.e|
|00005fe0| 63 68 6f 20 68 69 20 74 | 68 65 72 65 0d 65 63 68 |cho hi t|here.ech|
|00005ff0| 6f 20 6c 6f 20 74 68 65 | 72 65 0d 45 4f 43 0d 0d |o lo the|re.EOC..|
|00006000| 70 72 69 6e 74 20 3c 3c | 66 6f 6f 2c 20 3c 3c 62 |print <<|foo, <<b|
|00006010| 61 72 3b 20 23 20 79 6f | 75 20 63 61 6e 20 73 74 |ar; # yo|u can st|
|00006020| 61 63 6b 20 74 68 65 6d | 0d 49 20 73 61 69 64 20 |ack them|.I said |
|00006030| 66 6f 6f 2e 0d 66 6f 6f | 0d 49 20 73 61 69 64 20 |foo..foo|.I said |
|00006040| 62 61 72 2e 0d 62 61 72 | 0d 0d 41 72 72 61 79 20 |bar..bar|..Array |
|00006050| 6c 69 74 65 72 61 6c 73 | 20 61 72 65 20 64 65 6e |literals| are den|
|00006060| 6f 74 65 64 20 62 79 20 | 73 65 70 61 72 61 74 69 |oted by |separati|
|00006070| 6e 67 20 69 6e 64 69 76 | 69 64 75 61 6c 20 76 61 |ng indiv|idual va|
|00006080| 6c 75 65 73 20 62 79 0d | 63 6f 6d 6d 61 73 2c 20 |lues by.|commas, |
|00006090| 61 6e 64 20 65 6e 63 6c | 6f 73 69 6e 67 20 74 68 |and encl|osing th|
|000060a0| 65 20 6c 69 73 74 20 69 | 6e 20 70 61 72 65 6e 74 |e list i|n parent|
|000060b0| 68 65 73 65 73 3a 0d 0d | 20 20 20 20 20 28 4c 49 |heses:..| (LI|
|000060c0| 53 54 29 0d 0d 49 6e 20 | 61 20 63 6f 6e 74 65 78 |ST)..In |a contex|
|000060d0| 74 20 6e 6f 74 20 72 65 | 71 75 69 72 69 6e 67 20 |t not re|quiring |
|000060e0| 61 6e 20 61 72 72 61 79 | 20 76 61 6c 75 65 2c 20 |an array| value, |
|000060f0| 74 68 65 20 76 61 6c 75 | 65 20 6f 66 20 74 68 65 |the valu|e of the|
|00006100| 20 61 72 72 61 79 0d 6c | 69 74 65 72 61 6c 20 69 | array.l|iteral i|
|00006110| 73 20 74 68 65 20 76 61 | 6c 75 65 20 6f 66 20 74 |s the va|lue of t|
|00006120| 68 65 20 66 69 6e 61 6c | 20 65 6c 65 6d 65 6e 74 |he final| element|
|00006130| 2c 20 61 73 20 69 6e 20 | 74 68 65 20 43 20 63 6f |, as in |the C co|
|00006140| 6d 6d 61 0d 6f 70 65 72 | 61 74 6f 72 2e 20 20 46 |mma.oper|ator. F|
|00006150| 6f 72 20 65 78 61 6d 70 | 6c 65 2c 0d 0d 20 20 20 |or examp|le,.. |
|00006160| 20 20 20 20 20 20 20 40 | 66 6f 6f 20 3d 20 28 27 | @|foo = ('|
|00006170| 63 63 27 2c 20 27 2d 45 | 27 2c 20 24 62 61 72 29 |cc', '-E|', $bar)|
|00006180| 3b 0d 0d 61 73 73 69 67 | 6e 73 20 74 68 65 20 65 |;..assig|ns the e|
|00006190| 6e 74 69 72 65 20 61 72 | 72 61 79 20 76 61 6c 75 |ntire ar|ray valu|
|000061a0| 65 20 74 6f 20 61 72 72 | 61 79 20 66 6f 6f 2c 20 |e to arr|ay foo, |
|000061b0| 62 75 74 0d 0d 20 20 20 | 20 20 20 20 20 20 20 24 |but.. | $|
|000061c0| 66 6f 6f 20 3d 20 28 27 | 63 63 27 2c 20 27 2d 45 |foo = ('|cc', '-E|
|000061d0| 27 2c 20 24 62 61 72 29 | 3b 0d 0d 61 73 73 69 67 |', $bar)|;..assig|
|000061e0| 6e 73 20 74 68 65 20 76 | 61 6c 75 65 20 6f 66 20 |ns the v|alue of |
|000061f0| 76 61 72 69 61 62 6c 65 | 20 62 61 72 20 74 6f 20 |variable| bar to |
|00006200| 76 61 72 69 61 62 6c 65 | 20 66 6f 6f 2e 20 20 4e |variable| foo. N|
|00006210| 6f 74 65 20 74 68 61 74 | 20 74 68 65 0d 76 61 6c |ote that| the.val|
|00006220| 75 65 20 6f 66 20 61 6e | 20 61 63 74 75 61 6c 20 |ue of an| actual |
|00006230| 61 72 72 61 79 20 69 6e | 20 61 20 73 63 61 6c 61 |array in| a scala|
|00006240| 72 20 63 6f 6e 74 65 78 | 74 20 69 73 20 74 68 65 |r contex|t is the|
|00006250| 20 6c 65 6e 67 74 68 20 | 6f 66 20 74 68 65 0d 61 | length |of the.a|
|00006260| 72 72 61 79 3b 20 74 68 | 65 20 66 6f 6c 6c 6f 77 |rray; th|e follow|
|00006270| 69 6e 67 20 61 73 73 69 | 67 6e 73 20 74 6f 20 24 |ing assi|gns to $|
|00006280| 66 6f 6f 20 74 68 65 20 | 76 61 6c 75 65 20 33 3a |foo the |value 3:|
|00006290| 0d 0d 20 20 20 20 20 20 | 20 20 20 20 40 66 6f 6f |.. | @foo|
|000062a0| 20 3d 20 28 27 63 63 27 | 2c 20 27 2d 45 27 2c 20 | = ('cc'|, '-E', |
|000062b0| 24 62 61 72 29 3b 0d 20 | 20 20 20 20 20 20 20 20 |$bar);. | |
|000062c0| 20 24 66 6f 6f 20 3d 20 | 40 66 6f 6f 3b 20 20 20 | $foo = |@foo; |
|000062d0| 20 20 20 20 20 20 23 20 | 24 66 6f 6f 20 67 65 74 | # |$foo get|
|000062e0| 73 20 33 0d 0d 59 6f 75 | 20 6d 61 79 20 68 61 76 |s 3..You| may hav|
|000062f0| 65 20 61 6e 20 6f 70 74 | 69 6f 6e 61 6c 20 63 6f |e an opt|ional co|
|00006300| 6d 6d 61 20 62 65 66 6f | 72 65 20 74 68 65 20 63 |mma befo|re the c|
|00006310| 6c 6f 73 69 6e 67 20 70 | 61 72 65 6e 74 68 65 73 |losing p|arenthes|
|00006320| 69 73 20 6f 66 0d 61 6e | 20 61 72 72 61 79 20 6c |is of.an| array l|
|00006330| 69 74 65 72 61 6c 2c 20 | 73 6f 20 74 68 61 74 20 |iteral, |so that |
|00006340| 79 6f 75 20 63 61 6e 20 | 73 61 79 3a 0d 0d 20 20 |you can |say:.. |
|00006350| 20 20 20 40 66 6f 6f 20 | 3d 20 28 0d 20 20 20 20 | @foo |= (. |
|00006360| 20 31 2c 0d 20 20 20 20 | 20 32 2c 0d 20 20 20 20 | 1,. | 2,. |
|00006370| 20 33 2c 0d 20 20 20 20 | 20 29 3b 0d 0d 57 68 65 | 3,. | );..Whe|
|00006380| 6e 20 61 20 4c 49 53 54 | 20 69 73 20 65 76 61 6c |n a LIST| is eval|
|00006390| 75 61 74 65 64 2c 20 65 | 61 63 68 20 65 6c 65 6d |uated, e|ach elem|
|000063a0| 65 6e 74 20 6f 66 20 74 | 68 65 20 6c 69 73 74 20 |ent of t|he list |
|000063b0| 69 73 20 65 76 61 6c 75 | 61 74 65 64 0d 69 6e 20 |is evalu|ated.in |
|000063c0| 61 6e 20 61 72 72 61 79 | 20 63 6f 6e 74 65 78 74 |an array| context|
|000063d0| 2c 20 61 6e 64 20 74 68 | 65 20 72 65 73 75 6c 74 |, and th|e result|
|000063e0| 69 6e 67 20 61 72 72 61 | 79 20 76 61 6c 75 65 20 |ing arra|y value |
|000063f0| 69 73 20 69 6e 74 65 72 | 70 6f 2d 0d 6c 61 74 65 |is inter|po-.late|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.