home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Updates / Perl / Docs / !PerlDocs / Chapter16 / Text
Unknown  |  1997-07-17  |  115.1 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text


This file was not able to be converted.
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
100% file data default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| b8 cb 01 00 01 00 00 00 | 00 00 00 00 06 08 00 00 |........|........|
|00000010| 00 08 00 00 01 10 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 10 00 00 02 18 00 00 | c8 00 00 00 00 00 00 00 |........|........|
|00000030| 07 2c c1 00 00 00 00 00 | 00 18 00 00 a5 88 00 00 |.,......|........|
|00000040| 43 c4 d0 06 40 25 ff ff | 60 73 ff ff d8 3b 00 00 |C...@%..|`s...;..|
|00000050| 16 00 00 00 b0 fc 07 00 | 00 00 00 00 07 2c c1 00 |........|.....,..|
|00000060| 07 2c c1 00 07 2c c1 00 | 00 00 00 00 70 65 72 6c |.,...,..|....perl|
|00000070| 74 6f 6f 74 20 2d 20 54 | 6f 6d 27 73 20 6f 62 6a |toot - T|om's obj|
|00000080| 65 63 74 2d 05 05 6f 72 | 69 65 6e 74 65 64 20 74 |ect-..or|iented t|
|00000090| 75 74 6f 72 69 61 6c 20 | 66 6f 72 20 70 65 72 6c |utorial |for perl|
|000000a0| 0d 08 72 6c 07 2c c1 00 | 00 00 00 00 07 00 50 13 |..rl.,..|......P.|
|000000b0| 08 be 78 00 08 be 78 00 | 00 00 00 00 05 00 00 00 |..x...x.|........|
|000000c0| 00 88 00 00 a5 30 00 00 | 40 a2 5f 01 a0 98 fe ff |.....0..|@._.....|
|000000d0| f0 de fe ff 68 37 00 00 | 44 65 73 63 72 69 70 74 |....h7..|Descript|
|000000e0| 69 6f 6e 0d 08 69 70 74 | 08 bf 78 00 00 00 00 00 |ion..ipt|..x.....|
|000000f0| 00 30 00 00 05 80 00 00 | 00 90 9b 07 3f 40 fe ff |.0......|....?@..|
|00000100| 1f 6f fe ff 20 22 00 00 | 4f 62 6a 65 63 74 2d 6f |.o.. "..|Object-o|
|00000110| 72 69 65 6e 74 65 64 20 | 70 72 6f 67 72 61 6d 6d |riented |programm|
|00000120| 69 6e 67 20 69 73 20 61 | 20 62 69 67 20 73 65 6c |ing is a| big sel|
|00000130| 6c 65 72 20 74 68 65 73 | 65 20 64 61 79 73 2e 20 |ler thes|e days. |
|00000140| 20 53 6f 6d 65 20 6d 61 | 6e 61 67 65 72 73 20 77 | Some ma|nagers w|
|00000150| 6f 75 6c 64 20 72 61 74 | 68 65 72 20 68 61 76 65 |ould rat|her have|
|00000160| 20 6f 62 6a 65 63 74 73 | 20 74 68 61 6e 20 00 00 | objects| than ..|
|00000170| 00 80 00 00 a5 90 00 00 | 40 3c e4 06 18 08 fe ff |........|@<......|
|00000180| f8 36 fe ff 20 22 00 00 | 73 6c 69 63 65 64 20 62 |.6.. "..|sliced b|
|00000190| 72 65 61 64 2e 20 20 57 | 68 79 20 69 73 20 74 68 |read. W|hy is th|
|000001a0| 61 74 3f 20 20 57 68 61 | 74 27 73 20 73 6f 20 73 |at? Wha|t's so s|
|000001b0| 70 65 63 69 61 6c 20 61 | 62 6f 75 74 20 61 6e 20 |pecial a|bout an |
|000001c0| 6f 62 6a 65 63 74 3f 20 | 20 4a 75 73 74 20 77 68 |object? | Just wh|
|000001d0| 61 74 20 07 11 c0 78 00 | 11 c0 78 00 00 00 00 00 |at ...x.|..x.....|
|000001e0| 69 73 08 65 11 00 00 00 | 00 00 00 00 20 61 6e 20 |is.e....|.... an |
|000001f0| 6f 62 6a 65 63 74 20 61 | 6e 79 77 61 79 3f 0d 00 |object a|nyway?..|
|00000200| 00 90 00 00 05 84 00 00 | 00 b0 a8 07 41 99 fd ff |........|....A...|
|00000210| 21 c8 fd ff 20 22 00 00 | 41 6e 20 6f 62 6a 65 63 |!... "..|An objec|
|00000220| 74 20 69 73 20 6e 6f 74 | 68 69 6e 67 20 62 75 74 |t is not|hing but|
|00000230| 20 61 20 77 61 79 20 6f | 66 20 74 75 63 6b 69 6e | a way o|f tuckin|
|00000240| 67 20 61 77 61 79 20 63 | 6f 6d 70 6c 65 78 20 62 |g away c|omplex b|
|00000250| 65 68 61 76 69 6f 75 72 | 73 20 69 6e 74 6f 20 61 |ehaviour|s into a|
|00000260| 20 6e 65 61 74 20 6c 69 | 74 74 6c 65 20 65 61 73 | neat li|ttle eas|
|00000270| 79 2d 74 6f 2d 75 73 65 | 20 62 75 6e 64 6c 65 2e |y-to-use| bundle.|
|00000280| 20 20 00 00 00 84 00 00 | 05 84 00 00 00 74 db 07 | ......|.....t..|
|00000290| 1a 61 fd ff fa 8f fd ff | 20 22 00 00 28 54 68 69 |.a......| "..(Thi|
|000002a0| 73 20 69 73 20 77 68 61 | 74 20 70 72 6f 66 65 73 |s is wha|t profes|
|000002b0| 73 6f 72 73 20 63 61 6c | 6c 20 61 62 73 74 72 61 |sors cal|l abstra|
|000002c0| 63 74 69 6f 6e 2e 29 20 | 53 6d 61 72 74 20 70 65 |ction.) |Smart pe|
|000002d0| 6f 70 6c 65 20 77 68 6f | 20 68 61 76 65 20 6e 6f |ople who| have no|
|000002e0| 74 68 69 6e 67 20 74 6f | 20 64 6f 20 62 75 74 20 |thing to| do but |
|000002f0| 73 69 74 20 61 72 6f 75 | 6e 64 20 66 6f 72 20 77 |sit arou|nd for w|
|00000300| 65 65 6b 73 20 6f 6e 20 | 00 84 00 00 05 84 00 00 |eeks on |........|
|00000310| 00 90 9b 07 f3 28 fd ff | d3 57 fd ff 20 22 00 00 |.....(..|.W.. "..|
|00000320| 65 6e 64 20 66 69 67 75 | 72 69 6e 67 20 6f 75 74 |end figu|ring out|
|00000330| 20 72 65 61 6c 6c 79 20 | 68 61 72 64 20 70 72 6f | really |hard pro|
|00000340| 62 6c 65 6d 73 20 6d 61 | 6b 65 20 74 68 65 73 65 |blems ma|ke these|
|00000350| 20 6e 69 66 74 79 20 6f | 62 6a 65 63 74 73 20 74 | nifty o|bjects t|
|00000360| 68 61 74 20 65 76 65 6e | 20 72 65 67 75 6c 61 72 |hat even| regular|
|00000370| 20 70 65 6f 70 6c 65 20 | 63 61 6e 20 75 73 65 2e | people |can use.|
|00000380| 20 28 54 68 69 73 20 69 | 73 20 00 00 00 84 00 00 | (This i|s ......|
|00000390| 05 84 00 00 00 f0 98 07 | cc f0 fc ff ac 1f fd ff |........|........|
|000003a0| 20 22 00 00 77 68 61 74 | 20 70 72 6f 66 65 73 73 | "..what| profess|
|000003b0| 6f 72 73 20 63 61 6c 6c | 20 73 6f 66 74 77 61 72 |ors call| softwar|
|000003c0| 65 20 72 65 75 73 65 2e | 29 20 20 55 73 65 72 73 |e reuse.|) Users|
|000003d0| 20 28 77 65 6c 6c 2c 20 | 70 72 6f 67 72 61 6d 6d | (well, |programm|
|000003e0| 65 72 73 29 20 63 61 6e | 20 70 6c 61 79 20 77 69 |ers) can| play wi|
|000003f0| 74 68 20 74 68 69 73 20 | 6c 69 74 74 6c 65 20 62 |th this |little b|
|00000400| 75 6e 64 6c 65 20 61 6c | 6c 20 74 68 65 79 20 00 |undle al|l they .|
|00000410| 00 84 00 00 05 88 00 00 | 00 84 c8 07 a5 b8 fc ff |........|........|
|00000420| 85 e7 fc ff 20 22 00 00 | 77 61 6e 74 2c 20 62 75 |.... "..|want, bu|
|00000430| 74 20 74 68 65 79 20 61 | 72 65 6e 27 74 20 74 6f |t they a|ren't to|
|00000440| 20 6f 70 65 6e 20 69 74 | 20 75 70 20 61 6e 64 20 | open it| up and |
|00000450| 6d 65 73 73 20 77 69 74 | 68 20 74 68 65 20 69 6e |mess wit|h the in|
|00000460| 73 69 64 65 73 2e 20 20 | 4a 75 73 74 20 6c 69 6b |sides. |Just lik|
|00000470| 65 20 61 6e 20 65 78 70 | 65 6e 73 69 76 65 20 70 |e an exp|ensive p|
|00000480| 69 65 63 65 20 6f 66 20 | 68 61 72 64 77 61 72 65 |iece of |hardware|
|00000490| 2c 20 74 68 65 20 00 00 | 00 88 00 00 25 70 00 00 |, the ..|....%p..|
|000004a0| 40 f0 45 06 7e 80 fc ff | 5e af fc ff 20 22 00 00 |@.E.~...|^... "..|
|000004b0| 63 6f 6e 74 72 61 63 74 | 20 73 61 79 73 20 74 68 |contract| says th|
|000004c0| 61 74 20 79 6f 75 20 76 | 6f 69 64 20 74 68 65 20 |at you v|oid the |
|000004d0| 77 61 72 72 61 6e 74 79 | 20 69 66 20 79 6f 75 20 |warranty| if you |
|000004e0| 6d 75 63 6b 20 77 69 74 | 68 20 74 68 65 20 63 6f |muck wit|h the co|
|000004f0| 76 65 72 2e 20 20 53 6f | 20 64 6f 6e 27 74 20 64 |ver. So| don't d|
|00000500| 6f 20 74 68 61 74 2e 0d | 00 70 00 00 05 8c 00 00 |o that..|.p......|
|00000510| 00 f4 d0 07 a7 11 fc ff | 87 40 fc ff 20 22 00 00 |........|.@.. "..|
|00000520| 54 68 65 20 68 65 61 72 | 74 20 6f 66 20 6f 62 6a |The hear|t of obj|
|00000530| 65 63 74 73 20 69 73 20 | 74 68 65 20 63 6c 61 73 |ects is |the clas|
|00000540| 73 2c 20 61 20 70 72 6f | 74 65 63 74 65 64 20 6c |s, a pro|tected l|
|00000550| 69 74 74 6c 65 20 70 72 | 69 76 61 74 65 20 6e 61 |ittle pr|ivate na|
|00000560| 6d 65 73 70 61 63 65 20 | 66 75 6c 6c 20 6f 66 20 |mespace |full of |
|00000570| 64 61 74 61 20 61 6e 64 | 20 66 75 6e 63 74 69 6f |data and| functio|
|00000580| 6e 73 2e 20 20 41 20 63 | 6c 61 73 73 20 69 73 20 |ns. A c|lass is |
|00000590| 61 20 00 00 00 8c 00 00 | 05 88 00 00 00 04 f1 07 |a ......|........|
|000005a0| 80 d9 fb ff 60 08 fc ff | 20 22 00 00 73 65 74 20 |....`...| "..set |
|000005b0| 6f 66 20 72 65 6c 61 74 | 65 64 20 72 6f 75 74 69 |of relat|ed routi|
|000005c0| 6e 65 73 20 74 68 61 74 | 20 61 64 64 72 65 73 73 |nes that| address|
|000005d0| 65 73 20 73 6f 6d 65 20 | 70 72 6f 62 6c 65 6d 20 |es some |problem |
|000005e0| 61 72 65 61 2e 20 20 59 | 6f 75 20 63 61 6e 20 74 |area. Y|ou can t|
|000005f0| 68 69 6e 6b 20 6f 66 20 | 69 74 20 61 73 20 61 20 |hink of |it as a |
|00000600| 75 73 65 72 2d 64 65 66 | 69 6e 65 64 20 74 79 70 |user-def|ined typ|
|00000610| 65 2e 20 54 68 65 20 50 | 65 72 6c 20 00 88 00 00 |e. The P|erl ....|
|00000620| 05 80 00 00 00 84 92 07 | 59 a1 fb ff 39 d0 fb ff |........|Y...9...|
|00000630| 20 22 00 00 70 61 63 6b | 61 67 65 20 6d 65 63 68 | "..pack|age mech|
|00000640| 61 6e 69 73 6d 2c 20 61 | 6c 73 6f 20 75 73 65 64 |anism, a|lso used|
|00000650| 20 66 6f 72 20 6d 6f 72 | 65 20 74 72 61 64 69 74 | for mor|e tradit|
|00000660| 69 6f 6e 61 6c 20 6d 6f | 64 75 6c 65 73 2c 20 69 |ional mo|dules, i|
|00000670| 73 20 75 73 65 64 20 66 | 6f 72 20 63 6c 61 73 73 |s used f|or class|
|00000680| 20 6d 6f 64 75 6c 65 73 | 20 61 73 20 77 65 6c 6c | modules| as well|
|00000690| 2e 20 20 4f 62 6a 65 63 | 74 73 20 00 00 80 00 00 |. Objec|ts .....|
|000006a0| 25 58 00 00 40 a4 66 04 | 32 69 fb ff 12 98 fb ff |%X..@.f.|2i......|
|000006b0| 20 22 00 00 22 6c 69 76 | 65 22 20 69 6e 20 61 20 | ".."liv|e" in a |
|000006c0| 63 6c 61 73 73 2c 20 6d | 65 61 6e 69 6e 67 20 74 |class, m|eaning t|
|000006d0| 68 61 74 20 74 68 65 79 | 20 62 65 6c 6f 6e 67 20 |hat they| belong |
|000006e0| 74 6f 20 73 6f 6d 65 20 | 70 61 63 6b 61 67 65 2e |to some |package.|
|000006f0| 0d 00 00 00 00 58 00 00 | 05 84 00 00 00 88 c7 07 |.....X..|........|
|00000700| 5b fa fa ff 3b 29 fb ff | 20 22 00 00 4d 6f 72 65 |[...;)..| "..More|
|00000710| 20 6f 66 74 65 6e 20 74 | 68 61 6e 20 6e 6f 74 2c | often t|han not,|
|00000720| 20 74 68 65 20 63 6c 61 | 73 73 20 70 72 6f 76 69 | the cla|ss provi|
|00000730| 64 65 73 20 74 68 65 20 | 75 73 65 72 20 77 69 74 |des the |user wit|
|00000740| 68 20 6c 69 74 74 6c 65 | 20 62 75 6e 64 6c 65 73 |h little| bundles|
|00000750| 2e 20 54 68 65 73 65 20 | 62 75 6e 64 6c 65 73 20 |. These |bundles |
|00000760| 61 72 65 20 6f 62 6a 65 | 63 74 73 2e 20 20 54 68 |are obje|cts. Th|
|00000770| 65 79 20 6b 6e 6f 77 20 | 00 84 00 00 05 80 00 00 |ey know |........|
|00000780| 00 d0 76 07 34 c2 fa ff | 14 f1 fa ff 20 22 00 00 |..v.4...|.... "..|
|00000790| 77 68 6f 73 65 20 63 6c | 61 73 73 20 74 68 65 79 |whose cl|ass they|
|000007a0| 20 62 65 6c 6f 6e 67 20 | 74 6f 2c 20 61 6e 64 20 | belong |to, and |
|000007b0| 68 6f 77 20 74 6f 20 62 | 65 68 61 76 65 2e 20 20 |how to b|ehave. |
|000007c0| 55 73 65 72 73 20 61 73 | 6b 20 74 68 65 20 63 6c |Users as|k the cl|
|000007d0| 61 73 73 20 74 6f 20 64 | 6f 20 73 6f 6d 65 74 68 |ass to d|o someth|
|000007e0| 69 6e 67 2c 20 6c 69 6b | 65 20 22 67 69 76 65 20 |ing, lik|e "give |
|000007f0| 6d 65 20 61 6e 20 00 00 | 00 80 00 00 05 84 00 00 |me an ..|........|
|00000800| 00 28 a3 07 0d 8a fa ff | ed b8 fa ff 20 22 00 00 |.(......|.... "..|
|00000810| 6f 62 6a 65 63 74 2e 22 | 20 20 4f 72 20 74 68 65 |object."| Or the|
|00000820| 79 20 63 61 6e 20 61 73 | 6b 20 6f 6e 65 20 6f 66 |y can as|k one of|
|00000830| 20 74 68 65 73 65 20 6f | 62 6a 65 63 74 73 20 74 | these o|bjects t|
|00000840| 6f 20 64 6f 20 73 6f 6d | 65 74 68 69 6e 67 2e 20 |o do som|ething. |
|00000850| 41 73 6b 69 6e 67 20 61 | 20 63 6c 61 73 73 20 74 |Asking a| class t|
|00000860| 6f 20 64 6f 20 73 6f 6d | 65 74 68 69 6e 67 20 66 |o do som|ething f|
|00000870| 6f 72 20 79 6f 75 20 69 | 73 20 00 00 00 84 00 00 |or you i|s ......|
|00000880| 85 bc 00 00 00 9c f5 07 | e6 51 fa ff c6 80 fa ff |........|.Q......|
|00000890| 20 22 00 00 63 61 6c 6c | 69 6e 67 20 61 20 07 05 | "..call|ing a ..|
|000008a0| 11 c1 78 00 11 c1 78 00 | 00 00 00 00 63 6c 61 73 |..x...x.|....clas|
|000008b0| 73 20 6d 65 74 68 6f 64 | 08 20 69 74 11 00 00 00 |s method|. it....|
|000008c0| 00 00 00 00 2e 20 41 73 | 6b 69 6e 67 20 61 6e 20 |..... As|king an |
|000008d0| 6f 62 6a 65 63 74 20 74 | 6f 20 64 6f 20 73 6f 6d |object t|o do som|
|000008e0| 05 65 74 68 69 6e 67 20 | 66 6f 72 20 79 6f 75 20 |.ething |for you |
|000008f0| 69 73 20 63 61 6c 6c 69 | 6e 67 20 61 6e 20 07 6f |is calli|ng an .o|
|00000900| 11 c2 78 00 11 c2 78 00 | 00 00 00 00 6f 62 6a 65 |..x...x.|....obje|
|00000910| 63 74 20 6d 65 74 68 6f | 64 08 79 20 11 00 00 00 |ct metho|d.y ....|
|00000920| 00 00 00 00 2e 20 41 73 | 6b 69 6e 67 20 65 69 74 |..... As|king eit|
|00000930| 68 65 72 20 61 20 00 00 | 00 bc 00 00 85 a0 00 00 |her a ..|........|
|00000940| 00 c0 c2 07 bf 19 fa ff | 9f 48 fa ff 20 22 00 00 |........|.H.. "..|
|00000950| 63 6c 61 73 73 20 28 75 | 73 75 61 6c 6c 79 29 20 |class (u|sually) |
|00000960| 6f 72 20 61 6e 20 6f 62 | 6a 65 63 74 20 28 73 6f |or an ob|ject (so|
|00000970| 6d 65 74 69 6d 65 73 29 | 20 74 6f 20 67 69 76 65 |metimes)| to give|
|00000980| 20 79 6f 75 20 62 61 63 | 6b 20 61 6e 20 6f 62 6a | you bac|k an obj|
|00000990| 65 63 74 20 69 73 20 63 | 61 6c 6c 69 6e 67 20 61 |ect is c|alling a|
|000009a0| 20 07 72 72 11 c3 78 00 | 11 c3 78 00 00 00 00 00 | .rr..x.|..x.....|
|000009b0| 63 6f 6e 73 74 72 75 63 | 74 6f 72 08 11 00 00 00 |construc|tor.....|
|000009c0| 00 00 00 00 2c 20 77 68 | 69 63 68 20 69 73 20 6a |...., wh|ich is j|
|000009d0| 75 73 74 20 61 20 00 00 | 00 a0 00 00 25 28 00 00 |ust a ..|....%(..|
|000009e0| 40 2c 2a 01 98 e1 f9 ff | 78 10 fa ff 20 22 00 00 |@,*.....|x... "..|
|000009f0| 6b 69 6e 64 20 6f 66 20 | 6d 65 74 68 6f 64 2e 0d |kind of |method..|
|00000a00| 00 28 00 00 85 98 00 00 | 00 d4 ea 07 c1 72 f9 ff |.(......|.....r..|
|00000a10| a1 a1 f9 ff 20 22 00 00 | 54 68 61 74 27 73 20 61 |.... "..|That's a|
|00000a20| 6c 6c 20 77 65 6c 6c 20 | 61 6e 64 20 67 6f 6f 64 |ll well |and good|
|00000a30| 2c 20 62 75 74 20 68 6f | 77 20 69 73 20 61 6e 20 |, but ho|w is an |
|00000a40| 6f 62 6a 65 63 74 20 64 | 69 66 66 65 72 65 6e 74 |object d|ifferent|
|00000a50| 20 66 72 6f 6d 20 61 6e | 79 20 6f 74 68 65 72 20 | from an|y other |
|00000a60| 50 65 72 6c 20 64 61 74 | 61 20 74 79 70 65 3f 20 |Perl dat|a type? |
|00000a70| 20 4a 75 73 74 20 77 68 | 61 74 20 69 73 20 61 6e | Just wh|at is an|
|00000a80| 20 6f 62 6a 65 63 74 20 | 07 05 05 05 11 c4 78 00 | object |......x.|
|00000a90| 11 c4 78 00 00 00 00 00 | 00 98 00 00 85 94 00 00 |..x.....|........|
|00000aa0| 00 84 bf 07 9a 3a f9 ff | 7a 69 f9 ff f8 22 00 00 |.....:..|zi..."..|
|00000ab0| 72 65 61 6c 6c 79 08 74 | 11 00 00 00 00 00 00 00 |really.t|........|
|00000ac0| 3b 20 74 68 61 74 20 69 | 73 2c 20 77 68 61 74 27 |; that i|s, what'|
|00000ad0| 73 20 69 74 73 20 66 75 | 6e 64 61 6d 65 6e 74 61 |s its fu|ndamenta|
|00000ae0| 6c 20 74 79 70 65 3f 20 | 20 54 68 65 20 61 6e 73 |l type? | The ans|
|00000af0| 77 65 72 20 74 6f 20 74 | 68 65 20 66 69 72 73 74 |wer to t|he first|
|00000b00| 20 71 75 65 73 74 69 6f | 6e 20 69 73 20 65 61 73 | questio|n is eas|
|00000b10| 79 2e 20 20 41 6e 20 6f | 62 6a 65 63 74 20 69 73 |y. An o|bject is|
|00000b20| 20 64 69 66 66 65 72 65 | 6e 74 20 00 00 94 00 00 | differe|nt .....|
|00000b30| 05 84 00 00 00 30 e3 07 | 73 02 f9 ff 53 31 f9 ff |.....0..|s...S1..|
|00000b40| 20 22 00 00 66 72 6f 6d | 20 61 6e 79 20 6f 74 68 | "..from| any oth|
|00000b50| 65 72 20 64 61 74 61 20 | 74 79 70 65 20 69 6e 20 |er data |type in |
|00000b60| 50 65 72 6c 20 69 6e 20 | 6f 6e 65 20 61 6e 64 20 |Perl in |one and |
|00000b70| 6f 6e 6c 79 20 6f 6e 65 | 20 77 61 79 3a 20 79 6f |only one| way: yo|
|00000b80| 75 20 6d 61 79 20 64 65 | 72 65 66 65 72 65 6e 63 |u may de|referenc|
|00000b90| 65 20 69 74 20 75 73 69 | 6e 67 20 6e 6f 74 20 6d |e it usi|ng not m|
|00000ba0| 65 72 65 6c 79 20 73 74 | 72 69 6e 67 20 6f 72 20 |erely st|ring or |
|00000bb0| 00 84 00 00 85 8c 00 00 | 00 ec 75 07 4c ca f8 ff |........|..u.L...|
|00000bc0| 2c f9 f8 ff 20 22 00 00 | 6e 75 6d 65 72 69 63 20 |,... "..|numeric |
|00000bd0| 73 75 62 73 63 72 69 70 | 74 73 20 61 73 20 77 69 |subscrip|ts as wi|
|00000be0| 74 68 20 73 69 6d 70 6c | 65 20 61 72 72 61 79 73 |th simpl|e arrays|
|00000bf0| 20 61 6e 64 20 68 61 73 | 68 65 73 2c 20 62 75 74 | and has|hes, but|
|00000c00| 20 77 69 74 68 20 6e 61 | 6d 65 64 20 73 75 62 72 | with na|med subr|
|00000c10| 6f 75 74 69 6e 65 20 63 | 61 6c 6c 73 2e 20 49 6e |outine c|alls. In|
|00000c20| 20 61 20 77 6f 72 64 2c | 20 77 69 74 68 20 07 61 | a word,| with .a|
|00000c30| 11 c5 78 00 11 c5 78 00 | 00 00 00 00 00 8c 00 00 |..x...x.|........|
|00000c40| a5 2c 00 00 40 f4 a7 00 | 25 92 f8 ff 05 c1 f8 ff |.,..@...|%.......|
|00000c50| f8 22 00 00 6d 65 74 68 | 6f 64 73 08 11 00 00 00 |."..meth|ods.....|
|00000c60| 00 00 00 00 2e 0d 00 00 | 00 2c 00 00 05 84 00 00 |........|.,......|
|00000c70| 00 50 87 07 4e 23 f8 ff | 2e 52 f8 ff 20 22 00 00 |.P..N#..|.R.. "..|
|00000c80| 54 68 65 20 61 6e 73 77 | 65 72 20 74 6f 20 74 68 |The answ|er to th|
|00000c90| 65 20 73 65 63 6f 6e 64 | 20 71 75 65 73 74 69 6f |e second| questio|
|00000ca0| 6e 20 69 73 20 74 68 61 | 74 20 69 74 27 73 20 61 |n is tha|t it's a|
|00000cb0| 20 72 65 66 65 72 65 6e | 63 65 2c 20 61 6e 64 20 | referen|ce, and |
|00000cc0| 6e 6f 74 20 6a 75 73 74 | 20 61 6e 79 20 72 65 66 |not just| any ref|
|00000cd0| 65 72 65 6e 63 65 2c 20 | 6d 69 6e 64 20 79 6f 75 |erence, |mind you|
|00000ce0| 2c 20 62 75 74 20 6f 6e | 65 20 00 00 00 84 00 00 |, but on|e ......|
|00000cf0| 85 a4 00 00 00 18 e9 07 | 27 eb f7 ff 07 1a f8 ff |........|'.......|
|00000d00| 20 22 00 00 77 68 6f 73 | 65 20 72 65 66 65 72 65 | "..whos|e refere|
|00000d10| 6e 74 20 68 61 73 20 62 | 65 65 6e 20 07 73 20 77 |nt has b|een .s w|
|00000d20| 11 c6 78 00 11 c6 78 00 | 00 00 00 00 62 6c 65 73 |..x...x.|....bles|
|00000d30| 73 08 73 2e 11 00 00 00 | 00 00 00 00 28 29 65 64 |s.s.....|....()ed|
|00000d40| 20 69 6e 74 6f 20 61 20 | 70 61 72 74 69 63 75 6c | into a |particul|
|00000d50| 61 72 20 63 6c 61 73 73 | 20 28 72 65 61 64 3a 20 |ar class| (read: |
|00000d60| 70 61 63 6b 61 67 65 29 | 2e 20 20 57 68 61 74 20 |package)|. What |
|00000d70| 6b 69 6e 64 20 6f 66 20 | 72 65 66 65 72 65 6e 63 |kind of |referenc|
|00000d80| 65 3f 20 20 57 65 6c 6c | 2c 20 74 68 65 20 00 00 |e? Well|, the ..|
|00000d90| 00 a4 00 00 05 8c 00 00 | 00 bc ea 07 00 b3 f7 ff |........|........|
|00000da0| e0 e1 f7 ff 20 22 00 00 | 61 6e 73 77 65 72 20 74 |.... "..|answer t|
|00000db0| 6f 20 74 68 61 74 20 6f | 6e 65 20 69 73 20 61 20 |o that o|ne is a |
|00000dc0| 62 69 74 20 6c 65 73 73 | 20 63 6f 6e 63 72 65 74 |bit less| concret|
|00000dd0| 65 2e 20 20 54 68 61 74 | 27 73 20 62 65 63 61 75 |e. That|'s becau|
|00000de0| 73 65 20 69 6e 20 50 65 | 72 6c 20 74 68 65 20 64 |se in Pe|rl the d|
|00000df0| 65 73 69 67 6e 65 72 20 | 6f 66 20 74 68 65 20 63 |esigner |of the c|
|00000e00| 6c 61 73 73 20 63 61 6e | 20 65 6d 70 6c 6f 79 20 |lass can| employ |
|00000e10| 61 6e 79 20 73 6f 72 74 | 20 00 00 00 00 8c 00 00 |any sort| .......|
|00000e20| 05 84 00 00 00 48 4a 07 | d9 7a f7 ff b9 a9 f7 ff |.....HJ.|.z......|
|00000e30| 20 22 00 00 6f 66 20 72 | 65 66 65 72 65 6e 63 65 | "..of r|eference|
|00000e40| 20 74 68 65 79 27 64 20 | 6c 69 6b 65 20 61 73 20 | they'd |like as |
|00000e50| 74 68 65 20 75 6e 64 65 | 72 6c 79 69 6e 67 20 69 |the unde|rlying i|
|00000e60| 6e 74 72 69 6e 73 69 63 | 20 64 61 74 61 20 74 79 |ntrinsic| data ty|
|00000e70| 70 65 2e 20 20 49 74 20 | 63 6f 75 6c 64 20 62 65 |pe. It |could be|
|00000e80| 20 61 20 73 63 61 6c 61 | 72 2c 20 61 6e 20 61 72 | a scala|r, an ar|
|00000e90| 72 61 79 2c 20 6f 72 20 | 61 20 68 61 73 68 20 00 |ray, or |a hash .|
|00000ea0| 00 84 00 00 05 88 00 00 | 00 48 b6 07 b2 42 f7 ff |........|.H...B..|
|00000eb0| 92 71 f7 ff 20 22 00 00 | 72 65 66 65 72 65 6e 63 |.q.. "..|referenc|
|00000ec0| 65 2e 20 20 49 74 20 63 | 6f 75 6c 64 20 65 76 65 |e. It c|ould eve|
|00000ed0| 6e 20 62 65 20 61 20 63 | 6f 64 65 20 72 65 66 65 |n be a c|ode refe|
|00000ee0| 72 65 6e 63 65 2e 20 20 | 42 75 74 20 62 65 63 61 |rence. |But beca|
|00000ef0| 75 73 65 20 6f 66 20 69 | 74 73 20 69 6e 68 65 72 |use of i|ts inher|
|00000f00| 65 6e 74 20 66 6c 65 78 | 69 62 69 6c 69 74 79 2c |ent flex|ibility,|
|00000f10| 20 61 6e 20 6f 62 6a 65 | 63 74 20 69 73 20 75 73 | an obje|ct is us|
|00000f20| 75 61 6c 6c 79 20 61 20 | 00 88 00 00 a5 38 00 00 |ually a |.....8..|
|00000f30| 40 b0 1b 01 8b 0a f7 ff | 6b 39 f7 ff 20 22 00 00 |@.......|k9.. "..|
|00000f40| 68 61 73 68 20 72 65 66 | 65 72 65 6e 63 65 2e 0d |hash ref|erence..|
|00000f50| 07 2c 20 74 08 c7 78 00 | 08 c7 78 00 00 00 00 00 |., t..x.|..x.....|
|00000f60| 00 38 00 00 a5 34 00 00 | 40 ae 07 02 44 84 f6 ff |.8...4..|@...D...|
|00000f70| 94 ca f6 ff 68 37 00 00 | 43 72 65 61 74 69 6e 67 |....h7..|Creating|
|00000f80| 20 61 20 43 6c 61 73 73 | 0d 08 69 70 08 c8 78 00 | a Class|..ip..x.|
|00000f90| 00 00 00 00 00 34 00 00 | 05 80 00 00 00 6c 8f 07 |.....4..|.....l..|
|00000fa0| e3 2b f6 ff c3 5a f6 ff | 20 22 00 00 42 65 66 6f |.+...Z..| "..Befo|
|00000fb0| 72 65 20 79 6f 75 20 63 | 72 65 61 74 65 20 61 20 |re you c|reate a |
|00000fc0| 63 6c 61 73 73 2c 20 79 | 6f 75 20 6e 65 65 64 20 |class, y|ou need |
|00000fd0| 74 6f 20 64 65 63 69 64 | 65 20 77 68 61 74 20 74 |to decid|e what t|
|00000fe0| 6f 20 6e 61 6d 65 20 69 | 74 2e 20 20 54 68 61 74 |o name i|t. That|
|00000ff0| 27 73 20 62 65 63 61 75 | 73 65 20 74 68 65 20 63 |'s becau|se the c|
|00001000| 6c 61 73 73 20 28 70 61 | 63 6b 61 67 65 29 20 6e |lass (pa|ckage) n|
|00001010| 61 6d 65 20 00 80 00 00 | 05 84 00 00 00 18 71 07 |ame ....|......q.|
|00001020| bc f3 f5 ff 9c 22 f6 ff | 20 22 00 00 67 6f 76 65 |....."..| "..gove|
|00001030| 72 6e 73 20 74 68 65 20 | 6e 61 6d 65 20 6f 66 20 |rns the |name of |
|00001040| 74 68 65 20 66 69 6c 65 | 20 75 73 65 64 20 74 6f |the file| used to|
|00001050| 20 68 6f 75 73 65 20 69 | 74 2c 20 6a 75 73 74 20 | house i|t, just |
|00001060| 61 73 20 77 69 74 68 20 | 72 65 67 75 6c 61 72 20 |as with |regular |
|00001070| 6d 6f 64 75 6c 65 73 2e | 20 20 54 68 65 6e 2c 20 |modules.| Then, |
|00001080| 74 68 61 74 20 63 6c 61 | 73 73 20 28 70 61 63 6b |that cla|ss (pack|
|00001090| 61 67 65 29 20 00 00 00 | 00 84 00 00 05 84 00 00 |age) ...|........|
|000010a0| 00 14 db 07 95 bb f5 ff | 75 ea f5 ff 20 22 00 00 |........|u... "..|
|000010b0| 73 68 6f 75 6c 64 20 70 | 72 6f 76 69 64 65 20 6f |should p|rovide o|
|000010c0| 6e 65 20 6f 72 20 6d 6f | 72 65 20 77 61 79 73 20 |ne or mo|re ways |
|000010d0| 74 6f 20 67 65 6e 65 72 | 61 74 65 20 6f 62 6a 65 |to gener|ate obje|
|000010e0| 63 74 73 2e 20 20 46 69 | 6e 61 6c 6c 79 2c 20 69 |cts. Fi|nally, i|
|000010f0| 74 20 73 68 6f 75 6c 64 | 20 70 72 6f 76 69 64 65 |t should| provide|
|00001100| 20 6d 65 63 68 61 6e 69 | 73 6d 73 20 74 6f 20 61 | mechani|sms to a|
|00001110| 6c 6c 6f 77 20 75 73 65 | 72 73 20 00 00 84 00 00 |llow use|rs .....|
|00001120| 25 60 00 00 40 2c f0 04 | 6e 83 f5 ff 4e b2 f5 ff |%`..@,..|n...N...|
|00001130| 20 22 00 00 6f 66 20 69 | 74 73 20 6f 62 6a 65 63 | "..of i|ts objec|
|00001140| 74 73 20 74 6f 20 69 6e | 64 69 72 65 63 74 6c 79 |ts to in|directly|
|00001150| 20 6d 61 6e 69 70 75 6c | 61 74 65 20 74 68 65 73 | manipul|ate thes|
|00001160| 65 20 6f 62 6a 65 63 74 | 73 20 66 72 6f 6d 20 61 |e object|s from a|
|00001170| 20 64 69 73 74 61 6e 63 | 65 2e 0d 00 00 60 00 00 | distanc|e....`..|
|00001180| 05 88 00 00 00 e4 e3 07 | 97 14 f5 ff 77 43 f5 ff |........|....wC..|
|00001190| 20 22 00 00 46 6f 72 20 | 65 78 61 6d 70 6c 65 2c | "..For |example,|
|000011a0| 20 6c 65 74 27 73 20 6d | 61 6b 65 20 61 20 73 69 | let's m|ake a si|
|000011b0| 6d 70 6c 65 20 50 65 72 | 73 6f 6e 20 63 6c 61 73 |mple Per|son clas|
|000011c0| 73 20 6d 6f 64 75 6c 65 | 2e 20 20 49 74 20 67 65 |s module|. It ge|
|000011d0| 74 73 20 73 74 6f 72 65 | 64 20 69 6e 20 74 68 65 |ts store|d in the|
|000011e0| 20 66 69 6c 65 20 50 65 | 72 73 6f 6e 2e 70 6d 2e | file Pe|rson.pm.|
|000011f0| 20 20 49 66 20 69 74 20 | 77 65 72 65 20 63 61 6c | If it |were cal|
|00001200| 6c 65 64 20 00 88 00 00 | 05 7c 00 00 00 d0 79 07 |led ....|.|....y.|
|00001210| 70 dc f4 ff 50 0b f5 ff | 20 22 00 00 61 20 48 61 |p...P...| "..a Ha|
|00001220| 70 70 79 3a 3a 50 65 72 | 73 6f 6e 20 63 6c 61 73 |ppy::Per|son clas|
|00001230| 73 2c 20 69 74 20 77 6f | 75 6c 64 20 62 65 20 73 |s, it wo|uld be s|
|00001240| 74 6f 72 65 64 20 69 6e | 20 74 68 65 20 66 69 6c |tored in| the fil|
|00001250| 65 20 48 61 70 70 79 2f | 50 65 72 73 6f 6e 2e 70 |e Happy/|Person.p|
|00001260| 6d 2c 20 61 6e 64 20 69 | 74 73 20 70 61 63 6b 61 |m, and i|ts packa|
|00001270| 67 65 20 77 6f 75 6c 64 | 20 62 65 63 6f 6d 65 20 |ge would| become |
|00001280| 00 7c 00 00 05 84 00 00 | 00 90 ce 07 49 a4 f4 ff |.|......|....I...|
|00001290| 29 d3 f4 ff 20 22 00 00 | 48 61 70 70 79 3a 3a 50 |)... "..|Happy::P|
|000012a0| 65 72 73 6f 6e 20 69 6e | 73 74 65 61 64 20 6f 66 |erson in|stead of|
|000012b0| 20 6a 75 73 74 20 50 65 | 72 73 6f 6e 2e 20 20 28 | just Pe|rson. (|
|000012c0| 4f 6e 20 61 20 70 65 72 | 73 6f 6e 61 6c 20 63 6f |On a per|sonal co|
|000012d0| 6d 70 75 74 65 72 20 6e | 6f 74 20 72 75 6e 6e 69 |mputer n|ot runni|
|000012e0| 6e 67 20 55 6e 69 78 20 | 6f 72 20 50 6c 61 6e 20 |ng Unix |or Plan |
|000012f0| 39 2c 20 62 75 74 20 73 | 6f 6d 65 74 68 69 6e 67 |9, but s|omething|
|00001300| 20 00 00 00 00 84 00 00 | 05 84 00 00 00 6c f2 07 | .......|.....l..|
|00001310| 22 6c f4 ff 02 9b f4 ff | 20 22 00 00 6c 69 6b 65 |"l......| "..like|
|00001320| 20 4d 61 63 4f 53 20 6f | 72 20 56 4d 53 2c 20 74 | MacOS o|r VMS, t|
|00001330| 68 65 20 64 69 72 65 63 | 74 6f 72 79 20 73 65 70 |he direc|tory sep|
|00001340| 61 72 61 74 6f 72 20 6d | 61 79 20 62 65 20 64 69 |arator m|ay be di|
|00001350| 66 66 65 72 65 6e 74 2c | 20 62 75 74 20 74 68 65 |fferent,| but the|
|00001360| 20 70 72 69 6e 63 69 70 | 6c 65 20 69 73 20 74 68 | princip|le is th|
|00001370| 65 20 73 61 6d 65 2e 29 | 20 20 44 6f 20 6e 6f 74 |e same.)| Do not|
|00001380| 20 61 73 73 75 6d 65 20 | 00 84 00 00 05 7c 00 00 | assume |.....|..|
|00001390| 00 5c 4b 07 fb 33 f4 ff | db 62 f4 ff 20 22 00 00 |.\K..3..|.b.. "..|
|000013a0| 61 6e 79 20 66 6f 72 6d | 61 6c 20 72 65 6c 61 74 |any form|al relat|
|000013b0| 69 6f 6e 73 68 69 70 20 | 62 65 74 77 65 65 6e 20 |ionship |between |
|000013c0| 6d 6f 64 75 6c 65 73 20 | 62 61 73 65 64 20 6f 6e |modules |based on|
|000013d0| 20 74 68 65 69 72 20 64 | 69 72 65 63 74 6f 72 79 | their d|irectory|
|000013e0| 20 6e 61 6d 65 73 2e 20 | 54 68 69 73 20 69 73 20 | names. |This is |
|000013f0| 6d 65 72 65 6c 79 20 61 | 20 67 72 6f 75 70 69 6e |merely a| groupin|
|00001400| 67 20 00 00 00 7c 00 00 | 01 10 00 00 40 c8 43 06 |g ...|..|....@.C.|
|00001410| 00 00 00 00 00 10 00 00 | 02 14 00 00 64 02 00 00 |........|....d...|
|00001420| 00 00 00 00 00 00 00 00 | 00 14 00 00 25 80 00 00 |........|....%...|
|00001430| 40 c8 43 06 cf 44 f2 ff | af 73 f2 ff 20 22 00 00 |@.C..D..|.s.. "..|
|00001440| 16 00 00 00 b0 fc 07 00 | 00 00 00 00 63 6f 6e 76 |........|....conv|
|00001450| 65 6e 69 65 6e 63 65 2c | 20 61 6e 64 20 68 61 73 |enience,| and has|
|00001460| 20 6e 6f 20 65 66 66 65 | 63 74 20 6f 6e 20 69 6e | no effe|ct on in|
|00001470| 68 65 72 69 74 61 6e 63 | 65 2c 20 76 61 72 69 61 |heritanc|e, varia|
|00001480| 62 6c 65 20 61 63 63 65 | 73 73 69 62 69 6c 69 74 |ble acce|ssibilit|
|00001490| 79 2c 20 6f 72 20 61 6e | 79 74 68 69 6e 67 20 65 |y, or an|ything e|
|000014a0| 6c 73 65 2e 0d 00 00 00 | 00 80 00 00 05 80 00 00 |lse.....|........|
|000014b0| 00 74 9f 07 f8 d5 f1 ff | d8 04 f2 ff 20 22 00 00 |.t......|.... "..|
|000014c0| 46 6f 72 20 74 68 69 73 | 20 6d 6f 64 75 6c 65 20 |For this| module |
|000014d0| 77 65 20 61 72 65 6e 27 | 74 20 67 6f 69 6e 67 20 |we aren'|t going |
|000014e0| 74 6f 20 75 73 65 20 45 | 78 70 6f 72 74 65 72 2c |to use E|xporter,|
|000014f0| 20 62 65 63 61 75 73 65 | 20 77 65 27 72 65 20 61 | because| we're a|
|00001500| 20 77 65 6c 6c 2d 62 65 | 68 61 76 65 64 20 63 6c | well-be|haved cl|
|00001510| 61 73 73 20 6d 6f 64 75 | 6c 65 20 74 68 61 74 20 |ass modu|le that |
|00001520| 64 6f 65 73 6e 27 74 20 | 00 80 00 00 85 9c 00 00 |doesn't |........|
|00001530| 00 00 6e 07 d1 9d f1 ff | b1 cc f1 ff 20 22 00 00 |..n.....|.... "..|
|00001540| 65 78 70 6f 72 74 20 61 | 6e 79 74 68 69 6e 67 20 |export a|nything |
|00001550| 61 74 20 61 6c 6c 2e 20 | 49 6e 20 6f 72 64 65 72 |at all. |In order|
|00001560| 20 74 6f 20 6d 61 6e 75 | 66 61 63 74 75 72 65 20 | to manu|facture |
|00001570| 6f 62 6a 65 63 74 73 2c | 20 61 20 63 6c 61 73 73 |objects,| a class|
|00001580| 20 6e 65 65 64 73 20 74 | 6f 20 68 61 76 65 20 61 | needs t|o have a|
|00001590| 20 07 68 6f 11 c9 78 00 | 11 c9 78 00 00 00 00 00 | .ho..x.|..x.....|
|000015a0| 63 6f 6e 73 74 72 75 63 | 74 6f 72 20 6d 65 74 68 |construc|tor meth|
|000015b0| 6f 64 08 6c 11 00 00 00 | 00 00 00 00 2e 20 20 41 |od.l....|..... A|
|000015c0| 20 00 00 00 00 9c 00 00 | 05 88 00 00 00 70 c4 07 | .......|.....p..|
|000015d0| aa 65 f1 ff 8a 94 f1 ff | 20 22 00 00 63 6f 6e 73 |.e......| "..cons|
|000015e0| 74 72 75 63 74 6f 72 20 | 67 69 76 65 73 20 79 6f |tructor |gives yo|
|000015f0| 75 20 62 61 63 6b 20 6e | 6f 74 20 6a 75 73 74 20 |u back n|ot just |
|00001600| 61 20 72 65 67 75 6c 61 | 72 20 64 61 74 61 20 74 |a regula|r data t|
|00001610| 79 70 65 2c 20 62 75 74 | 20 61 20 62 72 61 6e 64 |ype, but| a brand|
|00001620| 2d 6e 65 77 20 6f 62 6a | 65 63 74 20 69 6e 20 74 |-new obj|ect in t|
|00001630| 68 61 74 20 63 6c 61 73 | 73 2e 20 20 54 68 69 73 |hat clas|s. This|
|00001640| 20 6d 61 67 69 63 20 69 | 73 20 00 00 00 88 00 00 | magic i|s ......|
|00001650| 05 88 00 00 00 18 9e 07 | 83 2d f1 ff 63 5c f1 ff |........|.-..c\..|
|00001660| 20 22 00 00 74 61 6b 65 | 6e 20 63 61 72 65 20 6f | "..take|n care o|
|00001670| 66 20 62 79 20 74 68 65 | 20 62 6c 65 73 73 28 29 |f by the| bless()|
|00001680| 20 66 75 6e 63 74 69 6f | 6e 2c 20 77 68 6f 73 65 | functio|n, whose|
|00001690| 20 73 6f 6c 65 20 70 75 | 72 70 6f 73 65 20 69 73 | sole pu|rpose is|
|000016a0| 20 74 6f 20 65 6e 61 62 | 6c 65 20 69 74 73 20 72 | to enab|le its r|
|000016b0| 65 66 65 72 65 6e 74 20 | 74 6f 20 62 65 20 75 73 |eferent |to be us|
|000016c0| 65 64 20 61 73 20 61 6e | 20 6f 62 6a 65 63 74 2e |ed as an| object.|
|000016d0| 20 20 00 00 00 88 00 00 | 25 7c 00 00 40 5c 8d 07 | ......|%|..@\..|
|000016e0| 5c f5 f0 ff 3c 24 f1 ff | 20 22 00 00 52 65 6d 65 |\...<$..| "..Reme|
|000016f0| 6d 62 65 72 3a 20 62 65 | 69 6e 67 20 61 6e 20 6f |mber: be|ing an o|
|00001700| 62 6a 65 63 74 20 72 65 | 61 6c 6c 79 20 6d 65 61 |bject re|ally mea|
|00001710| 6e 73 20 6e 6f 74 68 69 | 6e 67 20 6d 6f 72 65 20 |ns nothi|ng more |
|00001720| 74 68 61 6e 20 74 68 61 | 74 20 6d 65 74 68 6f 64 |than tha|t method|
|00001730| 73 20 6d 61 79 20 6e 6f | 77 20 62 65 20 63 61 6c |s may no|w be cal|
|00001740| 6c 65 64 20 61 67 61 69 | 6e 73 74 20 69 74 2e 0d |led agai|nst it..|
|00001750| 00 7c 00 00 05 80 00 00 | 00 c0 b3 07 85 86 f0 ff |.|......|........|
|00001760| 65 b5 f0 ff 20 22 00 00 | 57 68 69 6c 65 20 61 20 |e... "..|While a |
|00001770| 63 6f 6e 73 74 72 75 63 | 74 6f 72 20 6d 61 79 20 |construc|tor may |
|00001780| 62 65 20 6e 61 6d 65 64 | 20 61 6e 79 74 68 69 6e |be named| anythin|
|00001790| 67 20 79 6f 75 27 64 20 | 6c 69 6b 65 2c 20 6d 6f |g you'd |like, mo|
|000017a0| 73 74 20 50 65 72 6c 20 | 70 72 6f 67 72 61 6d 6d |st Perl |programm|
|000017b0| 65 72 73 20 73 65 65 6d | 20 74 6f 20 6c 69 6b 65 |ers seem| to like|
|000017c0| 20 74 6f 20 63 61 6c 6c | 20 74 68 65 69 72 73 20 | to call| theirs |
|000017d0| 00 80 00 00 05 80 00 00 | 00 f8 8d 07 5e 4e f0 ff |........|....^N..|
|000017e0| 3e 7d f0 ff 20 22 00 00 | 6e 65 77 28 29 2e 20 20 |>}.. "..|new(). |
|000017f0| 48 6f 77 65 76 65 72 2c | 20 6e 65 77 28 29 20 69 |However,| new() i|
|00001800| 73 20 6e 6f 74 20 61 20 | 72 65 73 65 72 76 65 64 |s not a |reserved|
|00001810| 20 77 6f 72 64 2c 20 61 | 6e 64 20 61 20 63 6c 61 | word, a|nd a cla|
|00001820| 73 73 20 69 73 20 75 6e | 64 65 72 20 6e 6f 20 6f |ss is un|der no o|
|00001830| 62 6c 69 67 61 74 69 6f | 6e 20 74 6f 20 73 75 70 |bligatio|n to sup|
|00001840| 70 6c 79 20 73 75 63 68 | 2e 20 53 6f 6d 65 20 00 |ply such|. Some .|
|00001850| 00 80 00 00 a5 8c 00 00 | 40 48 a7 07 37 16 f0 ff |........|@H..7...|
|00001860| 17 45 f0 ff 20 22 00 00 | 70 72 6f 67 72 61 6d 6d |.E.. "..|programm|
|00001870| 65 72 73 20 68 61 76 65 | 20 61 6c 73 6f 20 62 65 |ers have| also be|
|00001880| 65 6e 20 6b 6e 6f 77 6e | 20 74 6f 20 75 73 65 20 |en known| to use |
|00001890| 61 20 66 75 6e 63 74 69 | 6f 6e 20 77 69 74 68 20 |a functi|on with |
|000018a0| 74 68 65 20 73 61 6d 65 | 20 6e 61 6d 65 20 61 73 |the same| name as|
|000018b0| 20 74 68 65 20 63 6c 61 | 73 73 20 61 73 20 74 68 | the cla|ss as th|
|000018c0| 65 20 63 6f 6e 73 74 72 | 75 63 74 6f 72 2e 0d 07 |e constr|uctor...|
|000018d0| 0a ca 78 00 0a ca 78 00 | 00 00 00 00 00 8c 00 00 |..x...x.|........|
|000018e0| a5 38 00 00 40 16 20 02 | 90 9f ef ff 40 d6 ef ff |.8..@. .|....@...|
|000018f0| 18 2b 00 00 4f 62 6a 65 | 63 74 20 52 65 70 72 65 |.+..Obje|ct Repre|
|00001900| 73 65 6e 74 61 74 69 6f | 6e 0d 08 00 0a cb 78 00 |sentatio|n.....x.|
|00001910| 00 00 00 00 00 38 00 00 | 05 84 00 00 00 60 d4 07 |.....8..|.....`..|
|00001920| 5b 4a ef ff 3b 79 ef ff | 20 22 00 00 42 79 20 66 |[J..;y..| "..By f|
|00001930| 61 72 20 74 68 65 20 6d | 6f 73 74 20 63 6f 6d 6d |ar the m|ost comm|
|00001940| 6f 6e 20 6d 65 63 68 61 | 6e 69 73 6d 20 75 73 65 |on mecha|nism use|
|00001950| 64 20 69 6e 20 50 65 72 | 6c 20 74 6f 20 72 65 70 |d in Per|l to rep|
|00001960| 72 65 73 65 6e 74 20 61 | 20 50 61 73 63 61 6c 20 |resent a| Pascal |
|00001970| 72 65 63 6f 72 64 2c 20 | 61 20 43 20 73 74 72 75 |record, |a C stru|
|00001980| 63 74 2c 20 6f 72 20 61 | 20 43 2b 2b 20 63 6c 61 |ct, or a| C++ cla|
|00001990| 73 73 20 61 6e 20 00 00 | 00 84 00 00 05 84 00 00 |ss an ..|........|
|000019a0| 00 78 d4 07 34 12 ef ff | 14 41 ef ff 20 22 00 00 |.x..4...|.A.. "..|
|000019b0| 61 6e 6f 6e 79 6d 6f 75 | 73 20 68 61 73 68 2e 20 |anonymou|s hash. |
|000019c0| 20 54 68 61 74 27 73 20 | 62 65 63 61 75 73 65 20 | That's |because |
|000019d0| 61 20 68 61 73 68 20 68 | 61 73 20 61 6e 20 61 72 |a hash h|as an ar|
|000019e0| 62 69 74 72 61 72 79 20 | 6e 75 6d 62 65 72 20 6f |bitrary |number o|
|000019f0| 66 20 64 61 74 61 20 66 | 69 65 6c 64 73 2c 20 65 |f data f|ields, e|
|00001a00| 61 63 68 20 63 6f 6e 76 | 65 6e 69 65 6e 74 6c 79 |ach conv|eniently|
|00001a10| 20 61 63 63 65 73 73 65 | 64 20 00 00 00 84 00 00 | accesse|d ......|
|00001a20| a5 50 00 00 40 58 2c 03 | 0d da ee ff ed 08 ef ff |.P..@X,.|........|
|00001a30| 20 22 00 00 62 79 20 61 | 6e 20 61 72 62 69 74 72 | "..by a|n arbitr|
|00001a40| 61 72 79 20 6e 61 6d 65 | 20 6f 66 20 79 6f 75 72 |ary name| of your|
|00001a50| 20 6f 77 6e 20 64 65 76 | 69 73 69 6e 67 2e 0d 07 | own dev|ising...|
|00001a60| 14 cc 78 00 14 cc 78 00 | 00 00 00 00 00 50 00 00 |..x...x.|.....P..|
|00001a70| a5 b0 00 00 40 40 7f 07 | 36 6b ee ff 16 9a ee ff |....@@..|6k......|
|00001a80| 20 22 00 00 49 66 20 79 | 6f 75 20 77 65 72 65 20 | "..If y|ou were |
|00001a90| 6a 75 73 74 20 64 6f 69 | 6e 67 20 61 20 73 69 6d |just doi|ng a sim|
|00001aa0| 70 6c 65 20 73 74 72 75 | 63 74 2d 6c 69 6b 65 20 |ple stru|ct-like |
|00001ab0| 65 6d 75 6c 61 74 69 6f | 6e 2c 20 79 6f 75 20 77 |emulatio|n, you w|
|00001ac0| 6f 75 6c 64 20 6c 69 6b | 65 6c 79 20 67 6f 20 61 |ould lik|ely go a|
|00001ad0| 62 6f 75 74 20 69 74 20 | 73 6f 6d 65 74 68 69 6e |bout it |somethin|
|00001ae0| 67 20 6c 69 6b 65 20 74 | 68 69 73 3a 0d 08 69 6e |g like t|his:..in|
|00001af0| 14 00 00 00 00 00 00 00 | 07 20 25 64 12 cd 78 00 |........|. %d..x.|
|00001b00| 12 cd 78 00 00 00 00 00 | 07 22 2c 20 0c ce 78 00 |..x.....|.", ..x.|
|00001b10| 12 cd 78 00 0c ce 78 00 | 00 00 00 00 00 b0 00 00 |..x...x.|........|
|00001b20| 25 24 00 00 40 80 bb 00 | 2f 04 ee ff 3f 2b ee ff |%$..@...|/...?+..|
|00001b30| 70 1a 00 00 24 72 65 63 | 20 3d 20 7b 0d 00 00 00 |p...$rec| = {....|
|00001b40| 00 24 00 00 25 30 00 00 | 40 30 ec 01 4f d5 ed ff |.$..%0..|@0..O...|
|00001b50| 5f fc ed ff 70 1a 00 00 | 20 20 20 20 6e 61 6d 65 |_...p...| name|
|00001b60| 20 20 3d 3e 20 22 4a 61 | 73 6f 6e 22 2c 0d 00 00 | => "Ja|son",...|
|00001b70| 00 30 00 00 25 2c 00 00 | 40 00 77 01 6f a6 ed ff |.0..%,..|@.w.o...|
|00001b80| 7f cd ed ff 70 1a 00 00 | 20 20 20 20 61 67 65 20 |....p...| age |
|00001b90| 20 20 3d 3e 20 32 33 2c | 0d 00 00 00 00 2c 00 00 | => 23,|.....,..|
|00001ba0| 25 48 00 00 40 b0 1e 04 | 8f 77 ed ff 9f 9e ed ff |%H..@...|.w......|
|00001bb0| 70 1a 00 00 20 20 20 20 | 70 65 65 72 73 20 3d 3e |p... |peers =>|
|00001bc0| 20 5b 20 22 4e 6f 72 62 | 65 72 74 22 2c 20 22 52 | [ "Norb|ert", "R|
|00001bd0| 68 79 73 22 2c 20 22 50 | 68 69 6e 65 61 73 22 5d |hys", "P|hineas"]|
|00001be0| 2c 0d 00 00 00 48 00 00 | a5 44 00 00 40 e0 2e 00 |,....H..|.D..@...|
|00001bf0| af 48 ed ff bf 6f ed ff | 70 1a 00 00 7d 3b 0d 08 |.H...o..|p...};..|
|00001c00| 0c cf 78 00 12 cd 78 00 | 00 00 00 00 08 f7 78 00 |..x...x.|......x.|
|00001c10| 12 00 00 00 00 00 00 00 | 07 f8 78 00 18 d0 78 00 |........|..x...x.|
|00001c20| 18 d0 78 00 00 00 00 00 | 00 44 00 00 a5 34 00 00 |..x.....|.D...4..|
|00001c30| 40 00 00 00 1f 34 ed ff | df 40 ed ff 00 00 00 00 |@....4..|.@......|
|00001c40| 0d 08 61 73 18 d1 78 00 | 00 00 00 00 07 20 6b 6e |..as..x.|..... kn|
|00001c50| 14 d2 78 00 14 d2 78 00 | 00 00 00 00 00 34 00 00 |..x...x.|.....4..|
|00001c60| a5 a0 00 00 40 10 44 06 | 4f db ec ff 2f 0a ed ff |....@.D.|O.../...|
|00001c70| 20 22 00 00 49 66 20 79 | 6f 75 20 66 65 6c 74 20 | "..If y|ou felt |
|00001c80| 6c 69 6b 65 20 69 74 2c | 20 79 6f 75 20 63 6f 75 |like it,| you cou|
|00001c90| 6c 64 20 61 64 64 20 61 | 20 62 69 74 20 6f 66 20 |ld add a| bit of |
|00001ca0| 76 69 73 75 61 6c 20 64 | 69 73 74 69 6e 63 74 69 |visual d|istincti|
|00001cb0| 6f 6e 20 62 79 20 75 70 | 2d 63 61 73 69 6e 67 20 |on by up|-casing |
|00001cc0| 74 68 65 20 68 61 73 68 | 20 6b 65 79 73 3a 0d 08 |the hash| keys:..|
|00001cd0| 14 00 00 00 00 00 00 00 | 07 63 65 20 12 d3 78 00 |........|.ce ..x.|
|00001ce0| 12 d3 78 00 00 00 00 00 | 07 61 6e 64 0c d4 78 00 |..x.....|.and..x.|
|00001cf0| 12 d3 78 00 0c d4 78 00 | 00 00 00 00 00 a0 00 00 |..x...x.|........|
|00001d00| 25 24 00 00 40 80 bb 00 | 48 74 ec ff 58 9b ec ff |%$..@...|Ht..X...|
|00001d10| 70 1a 00 00 24 72 65 63 | 20 3d 20 7b 0d 00 00 00 |p...$rec| = {....|
|00001d20| 00 24 00 00 25 30 00 00 | 40 30 ec 01 68 45 ec ff |.$..%0..|@0..hE..|
|00001d30| 78 6c ec ff 70 1a 00 00 | 20 20 20 20 4e 41 4d 45 |xl..p...| NAME|
|00001d40| 20 20 3d 3e 20 22 4a 61 | 73 6f 6e 22 2c 0d 00 00 | => "Ja|son",...|
|00001d50| 00 30 00 00 25 2c 00 00 | 40 00 77 01 88 16 ec ff |.0..%,..|@.w.....|
|00001d60| 98 3d ec ff 70 1a 00 00 | 20 20 20 20 41 47 45 20 |.=..p...| AGE |
|00001d70| 20 20 3d 3e 20 32 33 2c | 0d 00 00 00 00 2c 00 00 | => 23,|.....,..|
|00001d80| 25 48 00 00 40 b0 1e 04 | a8 e7 eb ff b8 0e ec ff |%H..@...|........|
|00001d90| 70 1a 00 00 20 20 20 20 | 50 45 45 52 53 20 3d 3e |p... |PEERS =>|
|00001da0| 20 5b 20 22 4e 6f 72 62 | 65 72 74 22 2c 20 22 52 | [ "Norb|ert", "R|
|00001db0| 68 79 73 22 2c 20 22 50 | 68 69 6e 65 61 73 22 5d |hys", "P|hineas"]|
|00001dc0| 2c 0d 00 00 00 48 00 00 | a5 44 00 00 40 e0 2e 00 |,....H..|.D..@...|
|00001dd0| c8 b8 eb ff d8 df eb ff | 70 1a 00 00 7d 3b 0d 08 |........|p...};..|
|00001de0| 0c d5 78 00 12 d3 78 00 | 00 00 00 00 08 6c 61 73 |..x...x.|.....las|
|00001df0| 12 00 00 00 00 00 00 00 | 07 70 6c 65 18 d6 78 00 |........|.ple..x.|
|00001e00| 18 d6 78 00 00 00 00 00 | 00 44 00 00 a5 24 00 00 |..x.....|.D...$..|
|00001e10| 40 00 00 00 38 a4 eb ff | f8 b0 eb ff 00 00 00 00 |@...8...|........|
|00001e20| 0d 08 20 74 18 d7 78 00 | 00 00 00 00 00 24 00 00 |.. t..x.|.....$..|
|00001e30| 85 b0 00 00 00 04 f4 07 | 68 4b eb ff 48 7a eb ff |........|hK..Hz..|
|00001e40| 20 22 00 00 41 6e 64 20 | 73 6f 20 79 6f 75 20 63 | "..And |so you c|
|00001e50| 6f 75 6c 64 20 67 65 74 | 20 61 74 20 07 63 6c 61 |ould get| at .cla|
|00001e60| 0e d8 78 00 0e d8 78 00 | 00 00 00 00 24 72 65 63 |..x...x.|....$rec|
|00001e70| 2d 3e 7b 4e 41 4d 45 7d | 08 68 2d 72 0e d9 78 00 |->{NAME}|.h-r..x.|
|00001e80| 00 00 00 00 20 74 6f 20 | 66 69 6e 64 20 22 4a 61 |.... to |find "Ja|
|00001e90| 73 6f 6e 22 2c 20 6f 72 | 20 07 6d 61 0e da 78 00 |son", or| .ma..x.|
|00001ea0| 0e da 78 00 00 00 00 00 | 40 7b 20 24 72 65 63 2d |..x.....|@{ $rec-|
|00001eb0| 3e 7b 50 45 45 52 53 7d | 20 7d 08 74 0e db 78 00 |>{PEERS}| }.t..x.|
|00001ec0| 00 00 00 00 20 74 6f 20 | 67 65 74 20 61 74 20 22 |.... to |get at "|
|00001ed0| 4e 6f 72 62 65 72 74 22 | 2c 20 00 00 00 b0 00 00 |Norbert"|, ......|
|00001ee0| 05 78 00 00 00 f4 8b 07 | 41 13 eb ff 21 42 eb ff |.x......|A...!B..|
|00001ef0| 20 22 00 00 22 52 68 79 | 73 22 2c 20 61 6e 64 20 | ".."Rhy|s", and |
|00001f00| 22 50 68 69 6e 65 61 73 | 22 2e 20 28 48 61 76 65 |"Phineas|". (Have|
|00001f10| 20 79 6f 75 20 65 76 65 | 72 20 6e 6f 74 69 63 65 | you eve|r notice|
|00001f20| 64 20 68 6f 77 20 6d 61 | 6e 79 20 32 33 2d 79 65 |d how ma|ny 23-ye|
|00001f30| 61 72 2d 6f 6c 64 20 70 | 72 6f 67 72 61 6d 6d 65 |ar-old p|rogramme|
|00001f40| 72 73 20 73 65 65 6d 20 | 74 6f 20 62 65 20 6e 61 |rs seem |to be na|
|00001f50| 6d 65 64 20 00 78 00 00 | 25 30 00 00 40 e0 a8 01 |med .x..|%0..@...|
|00001f60| 1a db ea ff fa 09 eb ff | 20 22 00 00 22 4a 61 73 |........| ".."Jas|
|00001f70| 6f 6e 22 20 74 68 65 73 | 65 20 64 61 79 73 3f 20 |on" thes|e days? |
|00001f80| 3a 2d 29 0d 00 30 00 00 | 05 80 00 00 00 1c 61 07 |:-)..0..|......a.|
|00001f90| 43 6c ea ff 23 9b ea ff | 20 22 00 00 54 68 69 73 |Cl..#...| "..This|
|00001fa0| 20 73 61 6d 65 20 6d 6f | 64 65 6c 20 69 73 20 6f | same mo|del is o|
|00001fb0| 66 74 65 6e 20 75 73 65 | 64 20 66 6f 72 20 63 6c |ften use|d for cl|
|00001fc0| 61 73 73 65 73 2c 20 61 | 6c 74 68 6f 75 67 68 20 |asses, a|lthough |
|00001fd0| 69 74 20 69 73 20 6e 6f | 74 20 63 6f 6e 73 69 64 |it is no|t consid|
|00001fe0| 65 72 65 64 20 74 68 65 | 20 70 69 6e 6e 61 63 6c |ered the| pinnacl|
|00001ff0| 65 20 6f 66 20 70 72 6f | 67 72 61 6d 6d 69 6e 67 |e of pro|gramming|
|00002000| 20 00 00 00 00 80 00 00 | 05 80 00 00 00 04 61 07 | .......|......a.|
|00002010| 1c 34 ea ff fc 62 ea ff | 20 22 00 00 70 72 6f 70 |.4...b..| "..prop|
|00002020| 72 69 65 74 79 20 66 6f | 72 20 66 6f 6c 6b 73 20 |riety fo|r folks |
|00002030| 66 72 6f 6d 20 6f 75 74 | 73 69 64 65 20 74 68 65 |from out|side the|
|00002040| 20 63 6c 61 73 73 20 74 | 6f 20 63 6f 6d 65 20 77 | class t|o come w|
|00002050| 61 6c 74 7a 69 6e 67 20 | 69 6e 74 6f 20 61 6e 20 |altzing |into an |
|00002060| 6f 62 6a 65 63 74 2c 20 | 62 72 61 7a 65 6e 6c 79 |object, |brazenly|
|00002070| 20 61 63 63 65 73 73 69 | 6e 67 20 69 74 73 20 64 | accessi|ng its d|
|00002080| 61 74 61 20 00 80 00 00 | 85 94 00 00 00 d0 eb 07 |ata ....|........|
|00002090| f5 fb e9 ff d5 2a ea ff | 20 22 00 00 6d 65 6d 62 |.....*..| "..memb|
|000020a0| 65 72 73 20 64 69 72 65 | 63 74 6c 79 2e 20 20 47 |ers dire|ctly. G|
|000020b0| 65 6e 65 72 61 6c 6c 79 | 20 73 70 65 61 6b 69 6e |enerally| speakin|
|000020c0| 67 2c 20 61 6e 20 6f 62 | 6a 65 63 74 20 73 68 6f |g, an ob|ject sho|
|000020d0| 75 6c 64 20 62 65 20 63 | 6f 6e 73 69 64 65 72 65 |uld be c|onsidere|
|000020e0| 64 20 61 6e 20 6f 70 61 | 71 75 65 20 63 6f 6f 6b |d an opa|que cook|
|000020f0| 69 65 20 74 68 61 74 20 | 79 6f 75 20 75 73 65 20 |ie that |you use |
|00002100| 07 66 29 3b 11 dc 78 00 | 11 dc 78 00 00 00 00 00 |.f);..x.|..x.....|
|00002110| 6f 62 6a 65 63 74 20 00 | 00 94 00 00 85 90 00 00 |object .|........|
|00002120| 00 04 f1 07 ce c3 e9 ff | ae f2 e9 ff f8 22 00 00 |........|....."..|
|00002130| 6d 65 74 68 6f 64 73 08 | 11 00 00 00 00 00 00 00 |methods.|........|
|00002140| 20 74 6f 20 61 63 63 65 | 73 73 2e 20 20 56 69 73 | to acce|ss. Vis|
|00002150| 75 61 6c 6c 79 2c 20 6d | 65 74 68 6f 64 73 20 6c |ually, m|ethods l|
|00002160| 6f 6f 6b 20 6c 69 6b 65 | 20 79 6f 75 27 72 65 20 |ook like| you're |
|00002170| 64 65 72 65 66 66 69 6e | 67 20 61 20 72 65 66 65 |dereffin|g a refe|
|00002180| 72 65 6e 63 65 20 75 73 | 69 6e 67 20 61 20 66 75 |rence us|ing a fu|
|00002190| 6e 63 74 69 6f 6e 20 6e | 61 6d 65 20 69 6e 73 74 |nction n|ame inst|
|000021a0| 65 61 64 20 6f 66 20 00 | 00 90 00 00 a5 3c 00 00 |ead of .|.....<..|
|000021b0| 40 1c 5e 01 a7 8b e9 ff | 87 ba e9 ff 20 22 00 00 |@.^.....|.... "..|
|000021c0| 62 72 61 63 6b 65 74 73 | 20 6f 72 20 62 72 61 63 |brackets| or brac|
|000021d0| 65 73 2e 0d 07 62 6a 65 | 0a dd 78 00 0a dd 78 00 |es...bje|..x...x.|
|000021e0| 00 00 00 00 00 3c 00 00 | a5 34 00 00 40 b6 6c 01 |.....<..|.4..@.l.|
|000021f0| 00 15 e9 ff b0 4b e9 ff | 18 2b 00 00 43 6c 61 73 |.....K..|.+..Clas|
|00002200| 73 20 49 6e 74 65 72 66 | 61 63 65 0d 08 20 20 20 |s Interf|ace.. |
|00002210| 0a de 78 00 00 00 00 00 | 00 34 00 00 05 88 00 00 |..x.....|.4......|
|00002220| 00 78 e6 07 cb bf e8 ff | ab ee e8 ff 20 22 00 00 |.x......|.... "..|
|00002230| 53 6f 6d 65 20 6c 61 6e | 67 75 61 67 65 73 20 70 |Some lan|guages p|
|00002240| 72 6f 76 69 64 65 20 61 | 20 66 6f 72 6d 61 6c 20 |rovide a| formal |
|00002250| 73 79 6e 74 61 63 74 69 | 63 20 69 6e 74 65 72 66 |syntacti|c interf|
|00002260| 61 63 65 20 74 6f 20 61 | 20 63 6c 61 73 73 27 73 |ace to a| class's|
|00002270| 20 6d 65 74 68 6f 64 73 | 2c 20 62 75 74 20 50 65 | methods|, but Pe|
|00002280| 72 6c 20 64 6f 65 73 20 | 6e 6f 74 2e 20 20 49 74 |rl does |not. It|
|00002290| 20 72 65 6c 69 65 73 20 | 6f 6e 20 79 6f 75 20 00 | relies |on you .|
|000022a0| 00 88 00 00 05 84 00 00 | 00 64 94 07 a4 87 e8 ff |........|.d......|
|000022b0| 84 b6 e8 ff 20 22 00 00 | 74 6f 20 72 65 61 64 20 |.... "..|to read |
|000022c0| 74 68 65 20 64 6f 63 75 | 6d 65 6e 74 61 74 69 6f |the docu|mentatio|
|000022d0| 6e 20 6f 66 20 65 61 63 | 68 20 63 6c 61 73 73 2e |n of eac|h class.|
|000022e0| 20 20 49 66 20 79 6f 75 | 20 74 72 79 20 74 6f 20 | If you| try to |
|000022f0| 63 61 6c 6c 20 61 6e 20 | 75 6e 64 65 66 69 6e 65 |call an |undefine|
|00002300| 64 20 6d 65 74 68 6f 64 | 20 6f 6e 20 61 6e 20 6f |d method| on an o|
|00002310| 62 6a 65 63 74 2c 20 50 | 65 72 6c 20 77 6f 6e 27 |bject, P|erl won'|
|00002320| 74 20 00 00 00 84 00 00 | 05 80 00 00 00 2c 6c 07 |t ......|.....,l.|
|00002330| 7d 4f e8 ff 5d 7e e8 ff | 20 22 00 00 63 6f 6d 70 |}O..]~..| "..comp|
|00002340| 6c 61 69 6e 2c 20 62 75 | 74 20 74 68 65 20 70 72 |lain, bu|t the pr|
|00002350| 6f 67 72 61 6d 20 77 69 | 6c 6c 20 74 72 69 67 67 |ogram wi|ll trigg|
|00002360| 65 72 20 61 6e 20 65 78 | 63 65 70 74 69 6f 6e 20 |er an ex|ception |
|00002370| 77 68 69 6c 65 20 69 74 | 27 73 20 72 75 6e 6e 69 |while it|'s runni|
|00002380| 6e 67 2e 20 4c 69 6b 65 | 77 69 73 65 2c 20 69 66 |ng. Like|wise, if|
|00002390| 20 79 6f 75 20 63 61 6c | 6c 20 61 20 6d 65 74 68 | you cal|l a meth|
|000023a0| 6f 64 20 00 00 80 00 00 | 05 80 00 00 00 9c ad 07 |od .....|........|
|000023b0| 56 17 e8 ff 36 46 e8 ff | 20 22 00 00 65 78 70 65 |V...6F..| "..expe|
|000023c0| 63 74 69 6e 67 20 61 20 | 70 72 69 6d 65 20 6e 75 |cting a |prime nu|
|000023d0| 6d 62 65 72 20 61 73 20 | 69 74 73 20 61 72 67 75 |mber as |its argu|
|000023e0| 6d 65 6e 74 20 77 69 74 | 68 20 61 20 6e 6f 6e 2d |ment wit|h a non-|
|000023f0| 70 72 69 6d 65 20 6f 6e | 65 20 69 6e 73 74 65 61 |prime on|e instea|
|00002400| 64 2c 20 79 6f 75 20 63 | 61 6e 27 74 20 65 78 70 |d, you c|an't exp|
|00002410| 65 63 74 20 74 68 65 20 | 63 6f 6d 70 69 6c 65 72 |ect the |compiler|
|00002420| 20 74 6f 20 00 80 00 00 | a5 78 00 00 40 58 96 05 | to ....|.x..@X..|
|00002430| 2f df e7 ff 0f 0e e8 ff | 20 22 00 00 63 61 74 63 |/.......| "..catc|
|00002440| 68 20 74 68 69 73 2e 20 | 28 57 65 6c 6c 2c 20 79 |h this. |(Well, y|
|00002450| 6f 75 20 63 61 6e 20 65 | 78 70 65 63 74 20 69 74 |ou can e|xpect it|
|00002460| 20 61 6c 6c 20 79 6f 75 | 20 6c 69 6b 65 2c 20 62 | all you| like, b|
|00002470| 75 74 20 69 74 27 73 20 | 6e 6f 74 20 67 6f 69 6e |ut it's |not goin|
|00002480| 67 20 74 6f 20 68 61 70 | 70 65 6e 2e 29 0d 07 6c |g to hap|pen.)..l|
|00002490| 14 df 78 00 14 df 78 00 | 00 00 00 00 00 78 00 00 |..x...x.|.....x..|
|000024a0| 01 10 00 00 01 7c 7f 07 | 00 00 00 00 00 10 00 00 |.....|..|........|
|000024b0| 02 18 00 00 00 04 00 00 | 00 00 00 00 14 df 78 00 |........|......x.|
|000024c0| 00 00 00 00 00 18 00 00 | 05 8c 00 00 00 7c 7f 07 |........|.....|..|
|000024d0| 1e 45 e5 ff fe 73 e5 ff | 20 22 00 00 16 00 00 00 |.E...s..| "......|
|000024e0| b0 fc 07 00 00 00 00 00 | 4c 65 74 27 73 20 73 75 |........|Let's su|
|000024f0| 70 70 6f 73 65 20 79 6f | 75 20 68 61 76 65 20 61 |ppose yo|u have a|
|00002500| 20 77 65 6c 6c 2d 65 64 | 75 63 61 74 65 64 20 75 | well-ed|ucated u|
|00002510| 73 65 72 20 6f 66 20 79 | 6f 75 72 20 50 65 72 73 |ser of y|our Pers|
|00002520| 6f 6e 20 63 6c 61 73 73 | 2c 20 73 6f 6d 65 6f 6e |on class|, someon|
|00002530| 65 20 77 68 6f 20 68 61 | 73 20 72 65 61 64 20 74 |e who ha|s read t|
|00002540| 68 65 20 64 6f 63 73 20 | 74 68 61 74 20 00 00 00 |he docs |that ...|
|00002550| 00 8c 00 00 a5 94 00 00 | 40 f0 a6 05 f7 0c e5 ff |........|@.......|
|00002560| d7 3b e5 ff 20 22 00 00 | 65 78 70 6c 61 69 6e 20 |.;.. "..|explain |
|00002570| 74 68 65 20 70 72 65 73 | 63 72 69 62 65 64 20 69 |the pres|cribed i|
|00002580| 6e 74 65 72 66 61 63 65 | 2e 20 20 48 65 72 65 27 |nterface|. Here'|
|00002590| 73 20 68 6f 77 20 74 68 | 65 79 20 6d 69 67 68 74 |s how th|ey might|
|000025a0| 20 75 73 65 20 74 68 65 | 20 50 65 72 73 6f 6e 20 | use the| Person |
|000025b0| 63 6c 61 73 73 3a 0d 08 | 14 00 00 00 00 00 00 00 |class:..|........|
|000025c0| 07 00 00 00 12 e0 78 00 | 12 e0 78 00 00 00 00 00 |......x.|..x.....|
|000025d0| 07 6e 3b 0d 0c e1 78 00 | 12 e0 78 00 0c e1 78 00 |.n;...x.|..x...x.|
|000025e0| 00 00 00 00 00 94 00 00 | a5 50 00 00 40 d0 01 01 |........|.P..@...|
|000025f0| f0 a5 e4 ff 00 cd e4 ff | 70 1a 00 00 75 73 65 20 |........|p...use |
|00002600| 50 65 72 73 6f 6e 3b 0d | 08 00 00 00 0c e2 78 00 |Person;.|......x.|
|00002610| 12 e0 78 00 00 00 00 00 | 08 72 65 73 12 00 00 00 |..x.....|.res....|
|00002620| 00 00 00 00 07 74 65 72 | 18 e3 78 00 18 e3 78 00 |.....ter|..x...x.|
|00002630| 00 00 00 00 00 50 00 00 | a5 48 00 00 40 00 00 00 |.....P..|.H..@...|
|00002640| 60 91 e4 ff 20 9e e4 ff | 00 00 00 00 0d 08 65 72 |`... ...|......er|
|00002650| 18 e4 78 00 00 00 00 00 | 07 3a 0d 08 12 e5 78 00 |..x.....|.:....x.|
|00002660| 12 e5 78 00 00 00 00 00 | 07 e0 78 00 0c e6 78 00 |..x.....|..x...x.|
|00002670| 12 e5 78 00 0c e6 78 00 | 00 00 00 00 00 48 00 00 |..x...x.|.....H..|
|00002680| 25 30 00 00 40 30 ec 01 | 60 40 e4 ff 70 67 e4 ff |%0..@0..|`@..pg..|
|00002690| 70 1a 00 00 24 68 69 6d | 20 3d 20 50 65 72 73 6f |p...$him| = Perso|
|000026a0| 6e 2d 3e 6e 65 77 28 29 | 3b 0d 00 00 00 30 00 00 |n->new()|;....0..|
|000026b0| 25 30 00 00 40 c0 d4 01 | 80 11 e4 ff 90 38 e4 ff |%0..@...|.....8..|
|000026c0| 70 1a 00 00 24 68 69 6d | 2d 3e 6e 61 6d 65 28 22 |p...$him|->name("|
|000026d0| 4a 61 73 6f 6e 22 29 3b | 0d 00 00 00 00 30 00 00 |Jason");|.....0..|
|000026e0| 25 28 00 00 40 20 48 01 | a0 e2 e3 ff b0 09 e4 ff |%(..@ H.|........|
|000026f0| 70 1a 00 00 24 68 69 6d | 2d 3e 61 67 65 28 32 33 |p...$him|->age(23|
|00002700| 29 3b 0d 00 00 28 00 00 | a5 70 00 00 40 40 07 04 |);...(..|.p..@@..|
|00002710| c0 b3 e3 ff d0 da e3 ff | 70 1a 00 00 24 68 69 6d |........|p...$him|
|00002720| 2d 3e 70 65 65 72 73 28 | 20 22 4e 6f 72 62 65 72 |->peers(| "Norber|
|00002730| 74 22 2c 20 22 52 68 79 | 73 22 2c 20 22 50 68 69 |t", "Rhy|s", "Phi|
|00002740| 6e 65 61 73 22 20 29 3b | 0d 08 72 79 0c e7 78 00 |neas" );|..ry..x.|
|00002750| 12 e5 78 00 00 00 00 00 | 08 74 61 6e 12 00 00 00 |..x.....|.tan....|
|00002760| 00 00 00 00 07 20 63 61 | 18 e8 78 00 18 e8 78 00 |..... ca|..x...x.|
|00002770| 00 00 00 00 00 70 00 00 | a5 48 00 00 40 00 00 00 |.....p..|.H..@...|
|00002780| 30 9f e3 ff f0 ab e3 ff | 00 00 00 00 0d 08 20 61 |0.......|...... a|
|00002790| 18 e9 78 00 00 00 00 00 | 07 61 74 65 12 ea 78 00 |..x.....|.ate..x.|
|000027a0| 12 ea 78 00 00 00 00 00 | 07 6b 65 2e 0c eb 78 00 |..x.....|.ke...x.|
|000027b0| 12 ea 78 00 0c eb 78 00 | 00 00 00 00 00 48 00 00 |..x...x.|.....H..|
|000027c0| a5 7c 00 00 40 10 09 05 | 30 4e e3 ff 40 75 e3 ff |.|..@...|0N..@u..|
|000027d0| 70 1a 00 00 70 75 73 68 | 20 40 41 6c 6c 5f 52 65 |p...push| @All_Re|
|000027e0| 63 73 2c 20 24 68 69 6d | 3b 20 20 23 20 73 61 76 |cs, $him|; # sav|
|000027f0| 65 20 6f 62 6a 65 63 74 | 20 69 6e 20 61 72 72 61 |e object| in arra|
|00002800| 79 20 66 6f 72 20 6c 61 | 74 65 72 0d 08 54 68 65 |y for la|ter..The|
|00002810| 0c ec 78 00 12 ea 78 00 | 00 00 00 00 08 65 6e 74 |..x...x.|.....ent|
|00002820| 12 00 00 00 00 00 00 00 | 07 6c 61 73 18 ed 78 00 |........|.las..x.|
|00002830| 18 ed 78 00 00 00 00 00 | 00 7c 00 00 a5 48 00 00 |..x.....|.|...H..|
|00002840| 40 00 00 00 a0 39 e3 ff | 60 46 e3 ff 00 00 00 00 |@....9..|`F......|
|00002850| 0d 08 73 65 18 ee 78 00 | 00 00 00 00 07 20 61 73 |..se..x.|..... as|
|00002860| 12 ef 78 00 12 ef 78 00 | 00 00 00 00 07 6e 20 63 |..x...x.|.....n c|
|00002870| 0c f0 78 00 12 ef 78 00 | 0c f0 78 00 00 00 00 00 |..x...x.|..x.....|
|00002880| 00 48 00 00 25 50 00 00 | 40 a0 f1 04 a0 e8 e2 ff |.H..%P..|@.......|
|00002890| b0 0f e3 ff 70 1a 00 00 | 70 72 69 6e 74 66 20 22 |....p...|printf "|
|000028a0| 25 73 20 69 73 20 25 64 | 20 79 65 61 72 73 20 6f |%s is %d| years o|
|000028b0| 6c 64 2e 5c 6e 22 2c 20 | 24 68 69 6d 2d 3e 6e 61 |ld.\n", |$him->na|
|000028c0| 6d 65 2c 20 24 68 69 6d | 2d 3e 61 67 65 3b 0d 00 |me, $him|->age;..|
|000028d0| 00 50 00 00 a5 7c 00 00 | 40 10 09 05 c0 b9 e2 ff |.P...|..|@.......|
|000028e0| d0 e0 e2 ff 70 1a 00 00 | 70 72 69 6e 74 20 22 48 |....p...|print "H|
|000028f0| 69 73 20 70 65 65 72 73 | 20 61 72 65 3a 20 22 2c |is peers| are: ",|
|00002900| 20 6a 6f 69 6e 28 22 2c | 20 22 2c 20 24 68 69 6d | join(",| ", $him|
|00002910| 2d 3e 70 65 65 72 73 29 | 2c 20 22 5c 6e 22 3b 0d |->peers)|, "\n";.|
|00002920| 08 20 61 20 0c f1 78 00 | 12 ef 78 00 00 00 00 00 |. a ..x.|..x.....|
|00002930| 08 69 62 6c 12 00 00 00 | 00 00 00 00 07 20 74 68 |.ibl....|..... th|
|00002940| 18 f2 78 00 18 f2 78 00 | 00 00 00 00 00 7c 00 00 |..x...x.|.....|..|
|00002950| a5 48 00 00 40 00 00 00 | 30 a5 e2 ff f0 b1 e2 ff |.H..@...|0.......|
|00002960| 00 00 00 00 0d 08 6c 20 | 18 f3 78 00 00 00 00 00 |......l |..x.....|
|00002970| 07 20 73 6f 12 f4 78 00 | 12 f4 78 00 00 00 00 00 |. so..x.|..x.....|
|00002980| 07 62 65 20 0c f5 78 00 | 12 f4 78 00 0c f5 78 00 |.be ..x.|..x...x.|
|00002990| 00 00 00 00 00 48 00 00 | a5 78 00 00 40 a0 f1 04 |.....H..|.x..@...|
|000029a0| 30 54 e2 ff 40 7b e2 ff | 70 1a 00 00 70 72 69 6e |0T..@{..|p...prin|
|000029b0| 74 66 20 22 4c 61 73 74 | 20 72 65 63 27 73 20 6e |tf "Last| rec's n|
|000029c0| 61 6d 65 20 69 73 20 25 | 73 5c 6e 22 2c 20 24 41 |ame is %|s\n", $A|
|000029d0| 6c 6c 5f 52 65 63 73 5b | 2d 31 5d 2d 3e 6e 61 6d |ll_Recs[|-1]->nam|
|000029e0| 65 3b 0d 08 0c f6 78 00 | 12 f4 78 00 00 00 00 00 |e;....x.|..x.....|
|000029f0| 08 0d 08 05 12 00 00 00 | 00 00 00 00 07 05 05 05 |........|........|
|00002a00| 18 f7 78 00 18 f7 78 00 | 00 00 00 00 00 78 00 00 |..x...x.|.....x..|
|00002a10| a5 24 00 00 40 00 00 00 | a0 3f e2 ff 60 4c e2 ff |.$..@...|.?..`L..|
|00002a20| 00 00 00 00 0d 08 20 50 | 18 f8 78 00 00 00 00 00 |...... P|..x.....|
|00002a30| 00 24 00 00 05 88 00 00 | 00 94 c4 07 d0 e6 e1 ff |.$......|........|
|00002a40| b0 15 e2 ff 20 22 00 00 | 41 73 20 79 6f 75 20 63 |.... "..|As you c|
|00002a50| 61 6e 20 73 65 65 2c 20 | 74 68 65 20 75 73 65 72 |an see, |the user|
|00002a60| 20 6f 66 20 74 68 65 20 | 63 6c 61 73 73 20 64 6f | of the |class do|
|00002a70| 65 73 6e 27 74 20 6b 6e | 6f 77 20 28 6f 72 20 61 |esn't kn|ow (or a|
|00002a80| 74 20 6c 65 61 73 74 2c | 20 68 61 73 20 6e 6f 20 |t least,| has no |
|00002a90| 62 75 73 69 6e 65 73 73 | 20 70 61 79 69 6e 67 20 |business| paying |
|00002aa0| 61 74 74 65 6e 74 69 6f | 6e 20 74 6f 20 74 68 65 |attentio|n to the|
|00002ab0| 20 66 61 63 74 29 20 00 | 00 88 00 00 05 88 00 00 | fact) .|........|
|00002ac0| 00 e0 96 07 a9 ae e1 ff | 89 dd e1 ff 20 22 00 00 |........|.... "..|
|00002ad0| 74 68 61 74 20 74 68 65 | 20 6f 62 6a 65 63 74 20 |that the| object |
|00002ae0| 68 61 73 20 6f 6e 65 20 | 70 61 72 74 69 63 75 6c |has one |particul|
|00002af0| 61 72 20 69 6d 70 6c 65 | 6d 65 6e 74 61 74 69 6f |ar imple|mentatio|
|00002b00| 6e 20 6f 72 20 61 6e 6f | 74 68 65 72 2e 20 20 54 |n or ano|ther. T|
|00002b10| 68 65 20 69 6e 74 65 72 | 66 61 63 65 20 74 6f 20 |he inter|face to |
|00002b20| 74 68 65 20 63 6c 61 73 | 73 20 61 6e 64 20 69 74 |the clas|s and it|
|00002b30| 73 20 6f 62 6a 65 63 74 | 73 20 69 73 20 00 00 00 |s object|s is ...|
|00002b40| 00 88 00 00 a5 7c 00 00 | 40 48 f1 05 82 76 e1 ff |.....|..|@H...v..|
|00002b50| 62 a5 e1 ff 20 22 00 00 | 65 78 63 6c 75 73 69 76 |b... "..|exclusiv|
|00002b60| 65 6c 79 20 76 69 61 20 | 6d 65 74 68 6f 64 73 2c |ely via |methods,|
|00002b70| 20 61 6e 64 20 74 68 61 | 74 27 73 20 61 6c 6c 20 | and tha|t's all |
|00002b80| 74 68 65 20 75 73 65 72 | 20 6f 66 20 74 68 65 20 |the user| of the |
|00002b90| 63 6c 61 73 73 20 73 68 | 6f 75 6c 64 20 65 76 65 |class sh|ould eve|
|00002ba0| 72 20 70 6c 61 79 20 77 | 69 74 68 2e 0d 07 79 00 |r play w|ith...y.|
|00002bb0| 0a f9 78 00 0a f9 78 00 | 00 00 00 00 00 7c 00 00 |..x...x.|.....|..|
|00002bc0| a5 44 00 00 40 3e 5f 03 | db ff e0 ff 8b 36 e1 ff |.D..@>_.|.....6..|
|00002bd0| 18 2b 00 00 43 6f 6e 73 | 74 72 75 63 74 6f 72 73 |.+..Cons|tructors|
|00002be0| 20 61 6e 64 20 49 6e 73 | 74 61 6e 63 65 20 4d 65 | and Ins|tance Me|
|00002bf0| 74 68 6f 64 73 0d 08 3d | 0a fa 78 00 00 00 00 00 |thods..=|..x.....|
|00002c00| 00 44 00 00 85 9c 00 00 | 00 4c dc 07 a6 aa e0 ff |.D......|.L......|
|00002c10| 86 d9 e0 ff 20 22 00 00 | 53 74 69 6c 6c 2c 20 07 |.... "..|Still, .|
|00002c20| 11 fb 78 00 11 fb 78 00 | 00 00 00 00 73 6f 6d 65 |..x...x.|....some|
|00002c30| 6f 6e 65 08 11 00 00 00 | 00 00 00 00 20 68 61 73 |one.....|.... has|
|00002c40| 20 74 6f 20 6b 6e 6f 77 | 20 77 68 61 74 27 73 20 | to know| what's |
|00002c50| 69 6e 20 74 68 65 20 6f | 62 6a 65 63 74 2e 20 20 |in the o|bject. |
|00002c60| 41 6e 64 20 74 68 61 74 | 20 73 6f 6d 65 6f 6e 65 |And that| someone|
|00002c70| 20 69 73 20 74 68 65 20 | 63 6c 61 73 73 2e 20 20 | is the |class. |
|00002c80| 49 74 20 69 6d 70 6c 65 | 6d 65 6e 74 73 20 6d 65 |It imple|ments me|
|00002c90| 74 68 6f 64 73 20 74 68 | 61 74 20 00 00 9c 00 00 |thods th|at .....|
|00002ca0| 05 80 00 00 00 d0 91 07 | 7f 72 e0 ff 5f a1 e0 ff |........|.r.._...|
|00002cb0| 20 22 00 00 74 68 65 20 | 70 72 6f 67 72 61 6d 6d | "..the |programm|
|00002cc0| 65 72 20 75 73 65 73 20 | 74 6f 20 61 63 63 65 73 |er uses |to acces|
|00002cd0| 73 20 74 68 65 20 6f 62 | 6a 65 63 74 2e 20 20 48 |s the ob|ject. H|
|00002ce0| 65 72 65 27 73 20 68 6f | 77 20 74 6f 20 69 6d 70 |ere's ho|w to imp|
|00002cf0| 6c 65 6d 65 6e 74 20 74 | 68 65 20 50 65 72 73 6f |lement t|he Perso|
|00002d00| 6e 20 63 6c 61 73 73 20 | 75 73 69 6e 67 20 74 68 |n class |using th|
|00002d10| 65 20 73 74 61 6e 64 61 | 72 64 20 00 00 80 00 00 |e standa|rd .....|
|00002d20| 05 84 00 00 00 c4 9a 07 | 58 3a e0 ff 38 69 e0 ff |........|X:..8i..|
|00002d30| 20 22 00 00 68 61 73 68 | 2d 72 65 66 2d 61 73 2d | "..hash|-ref-as-|
|00002d40| 61 6e 2d 6f 62 6a 65 63 | 74 20 69 64 69 6f 6d 2e |an-objec|t idiom.|
|00002d50| 20 20 57 65 27 6c 6c 20 | 6d 61 6b 65 20 61 20 63 | We'll |make a c|
|00002d60| 6c 61 73 73 20 6d 65 74 | 68 6f 64 20 63 61 6c 6c |lass met|hod call|
|00002d70| 65 64 20 6e 65 77 28 29 | 20 74 6f 20 61 63 74 20 |ed new()| to act |
|00002d80| 61 73 20 74 68 65 20 63 | 6f 6e 73 74 72 75 63 74 |as the c|onstruct|
|00002d90| 6f 72 2c 20 61 6e 64 20 | 74 68 72 65 65 20 00 00 |or, and |three ..|
|00002da0| 00 84 00 00 05 80 00 00 | 00 84 a7 07 31 02 e0 ff |........|....1...|
|00002db0| 11 31 e0 ff 20 22 00 00 | 6f 62 6a 65 63 74 20 6d |.1.. "..|object m|
|00002dc0| 65 74 68 6f 64 73 20 63 | 61 6c 6c 65 64 20 6e 61 |ethods c|alled na|
|00002dd0| 6d 65 28 29 2c 20 61 67 | 65 28 29 2c 20 61 6e 64 |me(), ag|e(), and|
|00002de0| 20 70 65 65 72 73 28 29 | 20 74 6f 20 67 65 74 20 | peers()| to get |
|00002df0| 61 74 20 70 65 72 2d 6f | 62 6a 65 63 74 20 64 61 |at per-o|bject da|
|00002e00| 74 61 20 68 69 64 64 65 | 6e 20 61 77 61 79 20 69 |ta hidde|n away i|
|00002e10| 6e 20 6f 75 72 20 61 6e | 6f 6e 79 6d 6f 75 73 20 |n our an|onymous |
|00002e20| 00 80 00 00 a5 40 00 00 | 40 a4 61 00 0a ca df ff |.....@..|@.a.....|
|00002e30| ea f8 df ff 20 22 00 00 | 68 61 73 68 2e 0d 07 65 |.... "..|hash...e|
|00002e40| 12 fc 78 00 12 fc 78 00 | 00 00 00 00 07 20 65 6e |..x...x.|..... en|
|00002e50| 0c fd 78 00 12 fc 78 00 | 0c fd 78 00 00 00 00 00 |..x...x.|..x.....|
|00002e60| 00 40 00 00 25 28 00 00 | 40 90 5f 01 03 63 df ff |.@..%(..|@._..c..|
|00002e70| 13 8a df ff 70 1a 00 00 | 70 61 63 6b 61 67 65 20 |....p...|package |
|00002e80| 50 65 72 73 6f 6e 3b 0d | 00 28 00 00 a5 50 00 00 |Person;.|.(...P..|
|00002e90| 40 d0 01 01 23 34 df ff | 33 5b df ff 70 1a 00 00 |@...#4..|3[..p...|
|00002ea0| 75 73 65 20 73 74 72 69 | 63 74 3b 0d 08 20 61 6e |use stri|ct;.. an|
|00002eb0| 0c fe 78 00 12 fc 78 00 | 00 00 00 00 08 73 20 74 |..x...x.|.....s t|
|00002ec0| 12 00 00 00 00 00 00 00 | 07 20 20 41 18 ff 78 00 |........|. A..x.|
|00002ed0| 18 ff 78 00 00 00 00 00 | 00 50 00 00 a5 48 00 00 |..x.....|.P...H..|
|00002ee0| 40 00 00 00 93 1f df ff | 53 2c df ff 00 00 00 00 |@.......|S,......|
|00002ef0| 0d 08 69 6e 18 00 79 00 | 00 00 00 00 07 72 75 63 |..in..y.|.....ruc|
|00002f00| 12 01 79 00 12 01 79 00 | 00 00 00 00 07 73 74 20 |..y...y.|.....st |
|00002f10| 0c 02 79 00 12 01 79 00 | 0c 02 79 00 00 00 00 00 |..y...y.|..y.....|
|00002f20| 00 48 00 00 25 4c 00 00 | 40 e0 93 04 93 ce de ff |.H..%L..|@.......|
|00002f30| a3 f5 de ff 70 1a 00 00 | 23 23 23 23 23 23 23 23 |....p...|########|
|00002f40| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00002f50| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00002f60| 23 23 23 23 23 23 23 23 | 23 23 0d 00 00 4c 00 00 |########|##...L..|
|00002f70| 25 4c 00 00 40 e0 93 04 | b3 9f de ff c3 c6 de ff |%L..@...|........|
|00002f80| 70 1a 00 00 23 23 20 74 | 68 65 20 6f 62 6a 65 63 |p...## t|he objec|
|00002f90| 74 20 63 6f 6e 73 74 72 | 75 63 74 6f 72 20 28 73 |t constr|uctor (s|
|00002fa0| 69 6d 70 6c 69 73 74 69 | 63 20 76 65 72 73 69 6f |implisti|c versio|
|00002fb0| 6e 29 20 20 23 23 0d 00 | 00 4c 00 00 25 4c 00 00 |n) ##..|.L..%L..|
|00002fc0| 40 e0 93 04 d3 70 de ff | e3 97 de ff 70 1a 00 00 |@....p..|....p...|
|00002fd0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00002fe0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00002ff0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00003000| 23 23 0d 00 00 4c 00 00 | 25 24 00 00 40 f0 d2 00 |##...L..|%$..@...|
|00003010| f3 41 de ff 03 69 de ff | 70 1a 00 00 73 75 62 20 |.A...i..|p...sub |
|00003020| 6e 65 77 20 7b 0d 00 00 | 00 24 00 00 25 2c 00 00 |new {...|.$..%,..|
|00003030| 40 50 bd 01 13 13 de ff | 23 3a de ff 70 1a 00 00 |@P......|#:..p...|
|00003040| 20 20 20 20 6d 79 20 24 | 73 65 6c 66 20 20 3d 20 | my $|self = |
|00003050| 7b 7d 3b 0d 00 2c 00 00 | 25 38 00 00 40 40 90 02 |{};..,..|%8..@@..|
|00003060| 33 e4 dd ff 43 0b de ff | 70 1a 00 00 20 20 20 20 |3...C...|p... |
|00003070| 24 73 65 6c 66 2d 3e 7b | 4e 41 4d 45 7d 20 20 20 |$self->{|NAME} |
|00003080| 3d 20 75 6e 64 65 66 3b | 0d 00 00 00 00 38 00 00 |= undef;|.....8..|
|00003090| 25 38 00 00 40 40 90 02 | 53 b5 dd ff 63 dc dd ff |%8..@@..|S...c...|
|000030a0| 70 1a 00 00 20 20 20 20 | 24 73 65 6c 66 2d 3e 7b |p... |$self->{|
|000030b0| 41 47 45 7d 20 20 20 20 | 3d 20 75 6e 64 65 66 3b |AGE} |= undef;|
|000030c0| 0d 00 00 00 00 38 00 00 | 25 34 00 00 40 f0 49 02 |.....8..|%4..@.I.|
|000030d0| 73 86 dd ff 83 ad dd ff | 70 1a 00 00 20 20 20 20 |s.......|p... |
|000030e0| 24 73 65 6c 66 2d 3e 7b | 50 45 45 52 53 7d 20 20 |$self->{|PEERS} |
|000030f0| 3d 20 5b 5d 3b 0d 00 00 | 00 34 00 00 25 44 00 00 |= [];...|.4..%D..|
|00003100| 40 d0 ef 03 93 57 dd ff | a3 7e dd ff 70 1a 00 00 |@....W..|.~..p...|
|00003110| 20 20 20 20 62 6c 65 73 | 73 28 24 73 65 6c 66 29 | bles|s($self)|
|00003120| 3b 20 20 20 20 20 20 20 | 20 20 20 20 23 20 62 75 |; | # bu|
|00003130| 74 20 73 65 65 20 62 65 | 6c 6f 77 0d 00 44 00 00 |t see be|low..D..|
|00003140| 25 2c 00 00 40 70 8e 01 | b3 28 dd ff c3 4f dd ff |%,..@p..|.(...O..|
|00003150| 70 1a 00 00 20 20 20 20 | 72 65 74 75 72 6e 20 24 |p... |return $|
|00003160| 73 65 6c 66 3b 0d 00 00 | 00 2c 00 00 a5 44 00 00 |self;...|.,...D..|
|00003170| 40 70 17 00 d3 f9 dc ff | e3 20 dd ff 70 1a 00 00 |@p......|. ..p...|
|00003180| 7d 0d 08 65 0c 03 79 00 | 12 01 79 00 00 00 00 00 |}..e..y.|..y.....|
|00003190| 08 63 61 74 12 00 00 00 | 00 00 00 00 07 65 20 66 |.cat....|.....e f|
|000031a0| 18 04 79 00 18 04 79 00 | 00 00 00 00 00 44 00 00 |..y...y.|.....D..|
|000031b0| a5 48 00 00 40 00 00 00 | 43 e5 dc ff 03 f2 dc ff |.H..@...|C.......|
|000031c0| 00 00 00 00 0d 08 79 20 | 18 05 79 00 00 00 00 00 |......y |..y.....|
|000031d0| 07 6f 6d 65 12 06 79 00 | 12 06 79 00 00 00 00 00 |.ome..y.|..y.....|
|000031e0| 07 20 74 68 0c 07 79 00 | 12 06 79 00 0c 07 79 00 |. th..y.|..y...y.|
|000031f0| 00 00 00 00 00 48 00 00 | 25 48 00 00 40 20 36 04 |.....H..|%H..@ 6.|
|00003200| 43 94 dc ff 53 bb dc ff | 70 1a 00 00 23 23 23 23 |C...S...|p...####|
|00003210| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00003220| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00003230| 23 23 23 23 23 23 23 23 | 23 23 0d 00 00 48 00 00 |########|##...H..|
|00003240| 25 48 00 00 40 20 36 04 | 63 65 dc ff 73 8c dc ff |%H..@ 6.|ce..s...|
|00003250| 70 1a 00 00 23 23 20 6d | 65 74 68 6f 64 73 20 74 |p...## m|ethods t|
|00003260| 6f 20 61 63 63 65 73 73 | 20 70 65 72 2d 6f 62 6a |o access| per-obj|
|00003270| 65 63 74 20 64 61 74 61 | 20 20 20 20 20 20 20 20 |ect data| |
|00003280| 23 23 0d 00 00 48 00 00 | 25 48 00 00 40 20 36 04 |##...H..|%H..@ 6.|
|00003290| 83 36 dc ff 93 5d dc ff | 70 1a 00 00 23 23 20 20 |.6...]..|p...## |
|000032a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000032b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000032c0| 20 20 20 20 20 20 20 20 | 23 23 0d 00 00 48 00 00 | |##...H..|
|000032d0| 25 48 00 00 40 20 36 04 | a3 07 dc ff b3 2e dc ff |%H..@ 6.|........|
|000032e0| 70 1a 00 00 23 23 20 57 | 69 74 68 20 61 72 67 73 |p...## W|ith args|
|000032f0| 2c 20 74 68 65 79 20 73 | 65 74 20 74 68 65 20 76 |, they s|et the v|
|00003300| 61 6c 75 65 2e 20 20 57 | 69 74 68 6f 75 74 20 20 |alue. W|ithout |
|00003310| 23 23 0d 00 00 48 00 00 | 25 48 00 00 40 20 36 04 |##...H..|%H..@ 6.|
|00003320| c3 d8 db ff d3 ff db ff | 70 1a 00 00 23 23 20 61 |........|p...## a|
|00003330| 6e 79 2c 20 74 68 65 79 | 20 6f 6e 6c 79 20 72 65 |ny, they| only re|
|00003340| 74 72 69 65 76 65 20 69 | 74 2f 74 68 65 6d 2e 20 |trieve i|t/them. |
|00003350| 20 20 20 20 20 20 20 20 | 23 23 0d 00 00 48 00 00 | |##...H..|
|00003360| a5 70 00 00 40 20 36 04 | e3 a9 db ff f3 d0 db ff |.p..@ 6.|........|
|00003370| 70 1a 00 00 23 23 23 23 | 23 23 23 23 23 23 23 23 |p...####|########|
|00003380| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00003390| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|000033a0| 23 23 0d 08 0c 08 79 00 | 12 06 79 00 00 00 00 00 |##....y.|..y.....|
|000033b0| 08 74 75 63 12 00 00 00 | 00 00 00 00 07 20 63 6f |.tuc....|..... co|
|000033c0| 18 09 79 00 18 09 79 00 | 00 00 00 00 00 70 00 00 |..y...y.|.....p..|
|000033d0| a5 48 00 00 40 00 00 00 | 53 95 db ff 13 a2 db ff |.H..@...|S.......|
|000033e0| 00 00 00 00 0d 08 73 79 | 18 0a 79 00 00 00 00 00 |......sy|..y.....|
|000033f0| 07 75 6e 64 12 0b 79 00 | 12 0b 79 00 00 00 00 00 |.und..y.|..y.....|
|00003400| 07 20 77 68 0c 0c 79 00 | 12 0b 79 00 0c 0c 79 00 |. wh..y.|..y...y.|
|00003410| 00 00 00 00 00 48 00 00 | 25 24 00 00 40 60 ea 00 |.....H..|%$..@`..|
|00003420| 53 44 db ff 63 6b db ff | 70 1a 00 00 73 75 62 20 |SD..ck..|p...sub |
|00003430| 6e 61 6d 65 20 7b 0d 00 | 00 24 00 00 25 30 00 00 |name {..|.$..%0..|
|00003440| 40 30 ec 01 73 15 db ff | 83 3c db ff 70 1a 00 00 |@0..s...|.<..p...|
|00003450| 20 20 20 20 6d 79 20 24 | 73 65 6c 66 20 3d 20 73 | my $|self = s|
|00003460| 68 69 66 74 3b 0d 00 00 | 00 30 00 00 25 40 00 00 |hift;...|.0..%@..|
|00003470| 40 30 63 03 93 e6 da ff | a3 0d db ff 70 1a 00 00 |@0c.....|....p...|
|00003480| 20 20 20 20 69 66 20 28 | 40 5f 29 20 7b 20 24 73 | if (|@_) { $s|
|00003490| 65 6c 66 2d 3e 7b 4e 41 | 4d 45 7d 20 3d 20 73 68 |elf->{NA|ME} = sh|
|000034a0| 69 66 74 20 7d 0d 00 00 | 00 40 00 00 25 34 00 00 |ift }...|.@..%4..|
|000034b0| 40 f0 49 02 b3 b7 da ff | c3 de da ff 70 1a 00 00 |@.I.....|....p...|
|000034c0| 20 20 20 20 72 65 74 75 | 72 6e 20 24 73 65 6c 66 | retu|rn $self|
|000034d0| 2d 3e 7b 4e 41 4d 45 7d | 3b 0d 00 00 00 34 00 00 |->{NAME}|;....4..|
|000034e0| a5 44 00 00 40 70 17 00 | d3 88 da ff e3 af da ff |.D..@p..|........|
|000034f0| 70 1a 00 00 7d 0d 08 73 | 0c 0d 79 00 12 0b 79 00 |p...}..s|..y...y.|
|00003500| 00 00 00 00 08 6f 67 72 | 12 00 00 00 00 00 00 00 |.....ogr|........|
|00003510| 07 61 6e 20 18 0e 79 00 | 18 0e 79 00 00 00 00 00 |.an ..y.|..y.....|
|00003520| 00 44 00 00 a5 48 00 00 | 40 00 00 00 43 74 da ff |.D...H..|@...Ct..|
|00003530| 03 81 da ff 00 00 00 00 | 0d 08 78 70 18 0f 79 00 |........|..xp..y.|
|00003540| 00 00 00 00 07 65 63 65 | 12 10 79 00 12 10 79 00 |.....ece|..y...y.|
|00003550| 00 00 00 00 07 20 74 68 | 0c 11 79 00 12 10 79 00 |..... th|..y...y.|
|00003560| 0c 11 79 00 00 00 00 00 | 00 48 00 00 01 10 00 00 |..y.....|.H......|
|00003570| 41 f0 d2 00 00 00 00 00 | 00 10 00 00 02 1c 00 00 |A.......|........|
|00003580| 9c 05 00 00 00 00 00 00 | 12 10 79 00 0c 11 79 00 |........|..y...y.|
|00003590| 00 00 00 00 00 1c 00 00 | 25 30 00 00 40 f0 d2 00 |........|%0..@...|
|000035a0| 3d 4d d8 ff 4d 74 d8 ff | 70 1a 00 00 16 00 00 00 |=M..Mt..|p.......|
|000035b0| b0 fc 07 00 00 00 00 00 | 73 75 62 20 61 67 65 20 |........|sub age |
|000035c0| 7b 0d 00 00 00 30 00 00 | 25 30 00 00 40 30 ec 01 |{....0..|%0..@0..|
|000035d0| 5d 1e d8 ff 6d 45 d8 ff | 70 1a 00 00 20 20 20 20 |]...mE..|p... |
|000035e0| 6d 79 20 24 73 65 6c 66 | 20 3d 20 73 68 69 66 74 |my $self| = shift|
|000035f0| 3b 0d 00 00 00 30 00 00 | 25 40 00 00 40 c0 4b 03 |;....0..|%@..@.K.|
|00003600| 7d ef d7 ff 8d 16 d8 ff | 70 1a 00 00 20 20 20 20 |}.......|p... |
|00003610| 69 66 20 28 40 5f 29 20 | 7b 20 24 73 65 6c 66 2d |if (@_) |{ $self-|
|00003620| 3e 7b 41 47 45 7d 20 3d | 20 73 68 69 66 74 20 7d |>{AGE} =| shift }|
|00003630| 0d 00 00 00 00 40 00 00 | 25 34 00 00 40 80 32 02 |.....@..|%4..@.2.|
|00003640| 9d c0 d7 ff ad e7 d7 ff | 70 1a 00 00 20 20 20 20 |........|p... |
|00003650| 72 65 74 75 72 6e 20 24 | 73 65 6c 66 2d 3e 7b 41 |return $|self->{A|
|00003660| 47 45 7d 3b 0d 00 00 00 | 00 34 00 00 a5 44 00 00 |GE};....|.4...D..|
|00003670| 40 70 17 00 bd 91 d7 ff | cd b8 d7 ff 70 1a 00 00 |@p......|....p...|
|00003680| 7d 0d 08 75 0c 12 79 00 | 12 10 79 00 00 00 00 00 |}..u..y.|..y.....|
|00003690| 08 64 72 65 12 00 00 00 | 00 00 00 00 07 20 70 72 |.dre....|..... pr|
|000036a0| 18 13 79 00 18 13 79 00 | 00 00 00 00 00 44 00 00 |..y...y.|.....D..|
|000036b0| a5 48 00 00 40 00 00 00 | 2d 7d d7 ff ed 89 d7 ff |.H..@...|-}......|
|000036c0| 00 00 00 00 0d 08 00 00 | 18 14 79 00 00 00 00 00 |........|..y.....|
|000036d0| 07 13 9c f4 12 15 79 00 | 12 15 79 00 00 00 00 00 |......y.|..y.....|
|000036e0| 07 65 63 68 0c 16 79 00 | 12 15 79 00 0c 16 79 00 |.ech..y.|..y...y.|
|000036f0| 00 00 00 00 00 48 00 00 | 25 24 00 00 40 d0 01 01 |.....H..|%$..@...|
|00003700| 2d 2c d7 ff 3d 53 d7 ff | 70 1a 00 00 73 75 62 20 |-,..=S..|p...sub |
|00003710| 70 65 65 72 73 20 7b 0d | 00 24 00 00 25 30 00 00 |peers {.|.$..%0..|
|00003720| 40 30 ec 01 4d fd d6 ff | 5d 24 d7 ff 70 1a 00 00 |@0..M...|]$..p...|
|00003730| 20 20 20 20 6d 79 20 24 | 73 65 6c 66 20 3d 20 73 | my $|self = s|
|00003740| 68 69 66 74 3b 0d 00 00 | 00 30 00 00 25 44 00 00 |hift;...|.0..%D..|
|00003750| 40 80 a9 03 6d ce d6 ff | 7d f5 d6 ff 70 1a 00 00 |@...m...|}...p...|
|00003760| 20 20 20 20 69 66 20 28 | 40 5f 29 20 7b 20 40 7b | if (|@_) { @{|
|00003770| 20 24 73 65 6c 66 2d 3e | 7b 50 45 45 52 53 7d 20 | $self->|{PEERS} |
|00003780| 7d 20 3d 20 40 5f 20 7d | 0d 00 00 00 00 44 00 00 |} = @_ }|.....D..|
|00003790| 25 38 00 00 40 90 d6 02 | 8d 9f d6 ff 9d c6 d6 ff |%8..@...|........|
|000037a0| 70 1a 00 00 20 20 20 20 | 72 65 74 75 72 6e 20 40 |p... |return @|
|000037b0| 7b 20 24 73 65 6c 66 2d | 3e 7b 50 45 45 52 53 7d |{ $self-|>{PEERS}|
|000037c0| 20 7d 3b 0d 00 38 00 00 | a5 44 00 00 40 70 17 00 | };..8..|.D..@p..|
|000037d0| ad 70 d6 ff bd 97 d6 ff | 70 1a 00 00 7d 0d 08 62 |.p......|p...}..b|
|000037e0| 0c 17 79 00 12 15 79 00 | 00 00 00 00 08 6b 6e 6f |..y...y.|.....kno|
|000037f0| 12 00 00 00 00 00 00 00 | 07 6c 61 73 18 18 79 00 |........|.las..y.|
|00003800| 18 18 79 00 00 00 00 00 | 00 44 00 00 a5 48 00 00 |..y.....|.D...H..|
|00003810| 40 00 00 00 1d 5c d6 ff | dd 68 d6 ff 00 00 00 00 |@....\..|.h......|
|00003820| 0d 08 55 73 18 19 79 00 | 00 00 00 00 07 68 65 20 |..Us..y.|.....he |
|00003830| 12 1a 79 00 12 1a 79 00 | 00 00 00 00 07 6f 6d 65 |..y...y.|.....ome|
|00003840| 0c 1b 79 00 12 1a 79 00 | 0c 1b 79 00 00 00 00 00 |..y...y.|..y.....|
|00003850| 00 48 00 00 a5 68 00 00 | 40 c0 4b 03 1d 0b d6 ff |.H...h..|@.K.....|
|00003860| 2d 32 d6 ff 70 1a 00 00 | 31 3b 20 20 23 20 73 6f |-2..p...|1; # so|
|00003870| 20 74 68 65 20 72 65 71 | 75 69 72 65 20 6f 72 20 | the req|uire or |
|00003880| 75 73 65 20 73 75 63 63 | 65 65 64 73 0d 08 6f 6d |use succ|eeds..om|
|00003890| 0c 1c 79 00 12 1a 79 00 | 00 00 00 00 08 67 20 61 |..y...y.|.....g a|
|000038a0| 12 00 00 00 00 00 00 00 | 07 20 64 6f 18 1d 79 00 |........|. do..y.|
|000038b0| 18 1d 79 00 00 00 00 00 | 00 68 00 00 a5 24 00 00 |..y.....|.h...$..|
|000038c0| 40 00 00 00 8d f6 d5 ff | 4d 03 d6 ff 00 00 00 00 |@.......|M.......|
|000038d0| 0d 08 78 00 18 1e 79 00 | 00 00 00 00 00 24 00 00 |..x...y.|.....$..|
|000038e0| 05 7c 00 00 00 14 06 07 | bd 9d d5 ff 9d cc d5 ff |.|......|........|
|000038f0| 20 22 00 00 57 65 27 76 | 65 20 63 72 65 61 74 65 | "..We'v|e create|
|00003900| 64 20 74 68 72 65 65 20 | 6d 65 74 68 6f 64 73 20 |d three |methods |
|00003910| 74 6f 20 61 63 63 65 73 | 73 20 61 6e 20 6f 62 6a |to acces|s an obj|
|00003920| 65 63 74 27 73 20 64 61 | 74 61 2c 20 6e 61 6d 65 |ect's da|ta, name|
|00003930| 28 29 2c 20 61 67 65 28 | 29 2c 20 61 6e 64 20 70 |(), age(|), and p|
|00003940| 65 65 72 73 28 29 2e 20 | 20 54 68 65 73 65 20 61 |eers(). | These a|
|00003950| 72 65 20 61 6c 6c 20 00 | 00 7c 00 00 05 88 00 00 |re all .|.|......|
|00003960| 00 38 a5 07 96 65 d5 ff | 76 94 d5 ff 20 22 00 00 |.8...e..|v... "..|
|00003970| 73 75 62 73 74 61 6e 74 | 69 61 6c 6c 79 20 73 69 |substant|ially si|
|00003980| 6d 69 6c 61 72 2e 20 20 | 49 66 20 63 61 6c 6c 65 |milar. |If calle|
|00003990| 64 20 77 69 74 68 20 61 | 6e 20 61 72 67 75 6d 65 |d with a|n argume|
|000039a0| 6e 74 2c 20 74 68 65 79 | 20 73 65 74 20 74 68 65 |nt, they| set the|
|000039b0| 20 61 70 70 72 6f 70 72 | 69 61 74 65 20 66 69 65 | appropr|iate fie|
|000039c0| 6c 64 3b 20 6f 74 68 65 | 72 77 69 73 65 20 74 68 |ld; othe|rwise th|
|000039d0| 65 79 20 72 65 74 75 72 | 6e 20 74 68 65 20 00 00 |ey retur|n the ..|
|000039e0| 00 88 00 00 a5 64 00 00 | 40 e0 5d 04 6f 2d d5 ff |.....d..|@.].o-..|
|000039f0| 4f 5c d5 ff 20 22 00 00 | 76 61 6c 75 65 20 68 65 |O\.. "..|value he|
|00003a00| 6c 64 20 62 79 20 74 68 | 61 74 20 66 69 65 6c 64 |ld by th|at field|
|00003a10| 2c 20 6d 65 61 6e 69 6e | 67 20 74 68 65 20 76 61 |, meanin|g the va|
|00003a20| 6c 75 65 20 6f 66 20 74 | 68 61 74 20 68 61 73 68 |lue of t|hat hash|
|00003a30| 20 6b 65 79 2e 0d 07 20 | 0a 1f 79 00 0a 1f 79 00 | key... |..y...y.|
|00003a40| 00 00 00 00 00 64 00 00 | a5 50 00 00 40 c4 21 04 |.....d..|.P..@.!.|
|00003a50| c8 b6 d4 ff 78 ed d4 ff | 18 2b 00 00 50 6c 61 6e |....x...|.+..Plan|
|00003a60| 6e 69 6e 67 20 66 6f 72 | 20 74 68 65 20 46 75 74 |ning for| the Fut|
|00003a70| 75 72 65 3a 20 42 65 74 | 74 65 72 20 43 6f 6e 73 |ure: Bet|ter Cons|
|00003a80| 74 72 75 63 74 6f 72 73 | 0d 08 74 68 0a 20 79 00 |tructors|..th. y.|
|00003a90| 00 00 00 00 00 50 00 00 | 05 7c 00 00 00 dc 88 07 |.....P..|.|......|
|00003aa0| 93 61 d4 ff 73 90 d4 ff | 20 22 00 00 45 76 65 6e |.a..s...| "..Even|
|00003ab0| 20 74 68 6f 75 67 68 20 | 61 74 20 74 68 69 73 20 | though |at this |
|00003ac0| 70 6f 69 6e 74 20 79 6f | 75 20 6d 61 79 20 6e 6f |point yo|u may no|
|00003ad0| 74 20 65 76 65 6e 20 6b | 6e 6f 77 20 77 68 61 74 |t even k|now what|
|00003ae0| 20 69 74 20 6d 65 61 6e | 73 2c 20 73 6f 6d 65 64 | it mean|s, somed|
|00003af0| 61 79 20 79 6f 75 27 72 | 65 20 67 6f 69 6e 67 20 |ay you'r|e going |
|00003b00| 74 6f 20 77 6f 72 72 79 | 20 61 62 6f 75 74 20 00 |to worry| about .|
|00003b10| 00 7c 00 00 05 88 00 00 | 00 8c c3 07 6c 29 d4 ff |.|......|....l)..|
|00003b20| 4c 58 d4 ff 20 22 00 00 | 69 6e 68 65 72 69 74 61 |LX.. "..|inherita|
|00003b30| 6e 63 65 2e 20 20 28 59 | 6f 75 20 63 61 6e 20 73 |nce. (Y|ou can s|
|00003b40| 61 66 65 6c 79 20 69 67 | 6e 6f 72 65 20 74 68 69 |afely ig|nore thi|
|00003b50| 73 20 66 6f 72 20 6e 6f | 77 20 61 6e 64 20 77 6f |s for no|w and wo|
|00003b60| 72 72 79 20 61 62 6f 75 | 74 20 69 74 20 6c 61 74 |rry abou|t it lat|
|00003b70| 65 72 20 69 66 20 79 6f | 75 27 64 20 6c 69 6b 65 |er if yo|u'd like|
|00003b80| 2e 29 20 20 54 6f 20 65 | 6e 73 75 72 65 20 74 68 |.) To e|nsure th|
|00003b90| 61 74 20 74 68 69 73 20 | 00 88 00 00 05 84 00 00 |at this |........|
|00003ba0| 00 5c ed 07 45 f1 d3 ff | 25 20 d4 ff 20 22 00 00 |.\..E...|% .. "..|
|00003bb0| 61 6c 6c 20 77 6f 72 6b | 73 20 6f 75 74 20 73 6d |all work|s out sm|
|00003bc0| 6f 6f 74 68 6c 79 2c 20 | 79 6f 75 20 6d 75 73 74 |oothly, |you must|
|00003bd0| 20 75 73 65 20 74 68 65 | 20 64 6f 75 62 6c 65 2d | use the| double-|
|00003be0| 61 72 67 75 6d 65 6e 74 | 20 66 6f 72 6d 20 6f 66 |argument| form of|
|00003bf0| 20 62 6c 65 73 73 28 29 | 2e 20 54 68 65 20 73 65 | bless()|. The se|
|00003c00| 63 6f 6e 64 20 61 72 67 | 75 6d 65 6e 74 20 69 73 |cond arg|ument is|
|00003c10| 20 74 68 65 20 63 6c 61 | 73 73 20 00 00 84 00 00 | the cla|ss .....|
|00003c20| 05 84 00 00 00 f4 ca 07 | 1e b9 d3 ff fe e7 d3 ff |........|........|
|00003c30| 20 22 00 00 69 6e 74 6f | 20 77 68 69 63 68 20 74 | "..into| which t|
|00003c40| 68 65 20 72 65 66 65 72 | 65 6e 74 20 77 69 6c 6c |he refer|ent will|
|00003c50| 20 62 65 20 62 6c 65 73 | 73 65 64 2e 20 42 79 20 | be bles|sed. By |
|00003c60| 6e 6f 74 20 61 73 73 75 | 6d 69 6e 67 20 6f 75 72 |not assu|ming our|
|00003c70| 20 6f 77 6e 20 63 6c 61 | 73 73 20 61 73 20 74 68 | own cla|ss as th|
|00003c80| 65 20 64 65 66 61 75 6c | 74 20 73 65 63 6f 6e 64 |e defaul|t second|
|00003c90| 20 61 72 67 75 6d 65 6e | 74 20 61 6e 64 20 00 00 | argumen|t and ..|
|00003ca0| 00 84 00 00 a5 74 00 00 | 40 c0 7c 05 f7 80 d3 ff |.....t..|@.|.....|
|00003cb0| d7 af d3 ff 20 22 00 00 | 69 6e 73 74 65 61 64 20 |.... "..|instead |
|00003cc0| 75 73 69 6e 67 20 74 68 | 65 20 63 6c 61 73 73 20 |using th|e class |
|00003cd0| 70 61 73 73 65 64 20 69 | 6e 74 6f 20 75 73 2c 20 |passed i|nto us, |
|00003ce0| 77 65 20 6d 61 6b 65 20 | 6f 75 72 20 63 6f 6e 73 |we make |our cons|
|00003cf0| 74 72 75 63 74 6f 72 20 | 69 6e 68 65 72 69 74 61 |tructor |inherita|
|00003d00| 62 6c 65 2e 0d 07 54 68 | 14 21 79 00 14 21 79 00 |ble...Th|.!y..!y.|
|00003d10| 00 00 00 00 00 74 00 00 | 05 88 00 00 00 d8 d4 07 |.....t..|........|
|00003d20| 20 12 d3 ff 00 41 d3 ff | 20 22 00 00 57 68 69 6c | ....A..| "..Whil|
|00003d30| 65 20 77 65 27 72 65 20 | 61 74 20 69 74 2c 20 6c |e we're |at it, l|
|00003d40| 65 74 27 73 20 6d 61 6b | 65 20 6f 75 72 20 63 6f |et's mak|e our co|
|00003d50| 6e 73 74 72 75 63 74 6f | 72 20 61 20 62 69 74 20 |nstructo|r a bit |
|00003d60| 6d 6f 72 65 20 66 6c 65 | 78 69 62 6c 65 2e 20 52 |more fle|xible. R|
|00003d70| 61 74 68 65 72 20 74 68 | 61 6e 20 62 65 69 6e 67 |ather th|an being|
|00003d80| 20 75 6e 69 71 75 65 6c | 79 20 61 20 63 6c 61 73 | uniquel|y a clas|
|00003d90| 73 20 6d 65 74 68 6f 64 | 2c 20 00 00 00 88 00 00 |s method|, ......|
|00003da0| a5 d4 00 00 40 f4 bb 07 | f9 d9 d2 ff d9 08 d3 ff |....@...|........|
|00003db0| 20 22 00 00 77 65 27 6c | 6c 20 73 65 74 20 69 74 | "..we'l|l set it|
|00003dc0| 20 75 70 20 73 6f 20 74 | 68 61 74 20 69 74 20 63 | up so t|hat it c|
|00003dd0| 61 6e 20 62 65 20 63 61 | 6c 6c 65 64 20 61 73 20 |an be ca|lled as |
|00003de0| 65 69 74 68 65 72 20 61 | 20 63 6c 61 73 73 20 6d |either a| class m|
|00003df0| 65 74 68 6f 64 20 07 73 | 11 22 79 00 14 21 79 00 |ethod .s|."y..!y.|
|00003e00| 11 22 79 00 00 00 00 00 | 6f 72 08 74 11 00 00 00 |."y.....|or.t....|
|00003e10| 14 21 79 00 00 00 00 00 | 20 61 6e 20 6f 62 6a 65 |.!y.....| an obje|
|00003e20| 63 74 20 6d 65 74 68 6f | 64 2e 20 20 54 68 61 74 |ct metho|d. That|
|00003e30| 20 77 61 79 20 79 6f 75 | 20 63 61 6e 20 73 61 79 | way you| can say|
|00003e40| 3a 0d 08 00 14 00 00 00 | 00 00 00 00 07 61 20 43 |:.......|.....a C|
|00003e50| 12 23 79 00 12 23 79 00 | 00 00 00 00 07 00 00 00 |.#y..#y.|........|
|00003e60| 0c 24 79 00 12 23 79 00 | 0c 24 79 00 00 00 00 00 |.$y..#y.|.$y.....|
|00003e70| 00 d4 00 00 25 30 00 00 | 40 30 ec 01 f2 72 d2 ff |....%0..|@0...r..|
|00003e80| 02 9a d2 ff 70 1a 00 00 | 24 6d 65 20 20 3d 20 50 |....p...|$me = P|
|00003e90| 65 72 73 6f 6e 2d 3e 6e | 65 77 28 29 3b 0d 00 00 |erson->n|ew();...|
|00003ea0| 00 30 00 00 a5 54 00 00 | 40 e0 a5 01 12 44 d2 ff |.0...T..|@....D..|
|00003eb0| 22 6b d2 ff 70 1a 00 00 | 24 68 69 6d 20 3d 20 24 |"k..p...|$him = $|
|00003ec0| 6d 65 2d 3e 6e 65 77 28 | 29 3b 0d 08 0c 25 79 00 |me->new(|);...%y.|
|00003ed0| 12 23 79 00 00 00 00 00 | 08 6f 66 20 12 00 00 00 |.#y.....|.of ....|
|00003ee0| 00 00 00 00 07 75 73 65 | 18 26 79 00 18 26 79 00 |.....use|.&y..&y.|
|00003ef0| 00 00 00 00 00 54 00 00 | a5 24 00 00 40 00 00 00 |.....T..|.$..@...|
|00003f00| 82 2f d2 ff 42 3c d2 ff | 00 00 00 00 0d 08 64 75 |./..B<..|......du|
|00003f10| 18 27 79 00 00 00 00 00 | 00 24 00 00 05 84 00 00 |.'y.....|.$......|
|00003f20| 00 d0 a3 07 b2 d6 d1 ff | 92 05 d2 ff 20 22 00 00 |........|.... "..|
|00003f30| 54 6f 20 64 6f 20 74 68 | 69 73 2c 20 61 6c 6c 20 |To do th|is, all |
|00003f40| 77 65 20 68 61 76 65 20 | 74 6f 20 64 6f 20 69 73 |we have |to do is|
|00003f50| 20 63 68 65 63 6b 20 77 | 68 65 74 68 65 72 20 77 | check w|hether w|
|00003f60| 68 61 74 20 77 61 73 20 | 70 61 73 73 65 64 20 69 |hat was |passed i|
|00003f70| 6e 20 77 61 73 20 61 20 | 72 65 66 65 72 65 6e 63 |n was a |referenc|
|00003f80| 65 20 6f 72 20 6e 6f 74 | 2e 20 20 49 66 20 73 6f |e or not|. If so|
|00003f90| 2c 20 77 65 20 77 65 72 | 65 20 00 00 00 84 00 00 |, we wer|e ......|
|00003fa0| 05 88 00 00 00 80 cf 07 | 8b 9e d1 ff 6b cd d1 ff |........|....k...|
|00003fb0| 20 22 00 00 69 6e 76 6f | 6b 65 64 20 61 73 20 61 | "..invo|ked as a|
|00003fc0| 6e 20 6f 62 6a 65 63 74 | 20 6d 65 74 68 6f 64 2c |n object| method,|
|00003fd0| 20 61 6e 64 20 77 65 20 | 6e 65 65 64 20 74 6f 20 | and we |need to |
|00003fe0| 65 78 74 72 61 63 74 20 | 74 68 65 20 70 61 63 6b |extract |the pack|
|00003ff0| 61 67 65 20 28 63 6c 61 | 73 73 29 20 75 73 69 6e |age (cla|ss) usin|
|00004000| 67 20 74 68 65 20 72 65 | 66 28 29 20 66 75 6e 63 |g the re|f() func|
|00004010| 74 69 6f 6e 2e 20 49 66 | 20 6e 6f 74 2c 20 77 65 |tion. If| not, we|
|00004020| 20 00 00 00 00 88 00 00 | a5 88 00 00 40 bc 6b 05 | .......|....@.k.|
|00004030| 64 66 d1 ff 44 95 d1 ff | 20 22 00 00 6a 75 73 74 |df..D...| "..just|
|00004040| 20 75 73 65 20 74 68 65 | 20 73 74 72 69 6e 67 20 | use the| string |
|00004050| 70 61 73 73 65 64 20 69 | 6e 20 61 73 20 74 68 65 |passed i|n as the|
|00004060| 20 70 61 63 6b 61 67 65 | 20 6e 61 6d 65 20 66 6f | package| name fo|
|00004070| 72 20 62 6c 65 73 73 69 | 6e 67 20 6f 75 72 20 72 |r blessi|ng our r|
|00004080| 65 66 65 72 65 6e 74 2e | 0d 07 61 70 12 28 79 00 |eferent.|..ap.(y.|
|00004090| 12 28 79 00 00 00 00 00 | 07 20 61 6e 0c 29 79 00 |.(y.....|. an.)y.|
|000040a0| 12 28 79 00 0c 29 79 00 | 00 00 00 00 00 88 00 00 |.(y..)y.|........|
|000040b0| 25 24 00 00 40 f0 d2 00 | 5d ff d0 ff 6d 26 d1 ff |%$..@...|]...m&..|
|000040c0| 70 1a 00 00 73 75 62 20 | 6e 65 77 20 7b 0d 00 00 |p...sub |new {...|
|000040d0| 00 24 00 00 25 30 00 00 | 40 a0 03 02 7d d0 d0 ff |.$..%0..|@...}...|
|000040e0| 8d f7 d0 ff 70 1a 00 00 | 20 20 20 20 6d 79 20 24 |....p...| my $|
|000040f0| 70 72 6f 74 6f 20 3d 20 | 73 68 69 66 74 3b 0d 00 |proto = |shift;..|
|00004100| 00 30 00 00 25 40 00 00 | 40 a0 7a 03 9d a1 d0 ff |.0..%@..|@.z.....|
|00004110| ad c8 d0 ff 70 1a 00 00 | 20 20 20 20 6d 79 20 24 |....p...| my $|
|00004120| 63 6c 61 73 73 20 3d 20 | 72 65 66 28 24 70 72 6f |class = |ref($pro|
|00004130| 74 6f 29 20 7c 7c 20 24 | 70 72 6f 74 6f 3b 0d 00 |to) || $|proto;..|
|00004140| 00 40 00 00 25 2c 00 00 | 40 50 bd 01 bd 72 d0 ff |.@..%,..|@P...r..|
|00004150| cd 99 d0 ff 70 1a 00 00 | 20 20 20 20 6d 79 20 24 |....p...| my $|
|00004160| 73 65 6c 66 20 20 3d 20 | 7b 7d 3b 0d 00 2c 00 00 |self = |{};..,..|
|00004170| 25 38 00 00 40 40 90 02 | dd 43 d0 ff ed 6a d0 ff |%8..@@..|.C...j..|
|00004180| 70 1a 00 00 20 20 20 20 | 24 73 65 6c 66 2d 3e 7b |p... |$self->{|
|00004190| 4e 41 4d 45 7d 20 20 20 | 3d 20 75 6e 64 65 66 3b |NAME} |= undef;|
|000041a0| 0d 00 00 00 00 38 00 00 | 25 38 00 00 40 40 90 02 |.....8..|%8..@@..|
|000041b0| fd 14 d0 ff 0d 3c d0 ff | 70 1a 00 00 20 20 20 20 |.....<..|p... |
|000041c0| 24 73 65 6c 66 2d 3e 7b | 41 47 45 7d 20 20 20 20 |$self->{|AGE} |
|000041d0| 3d 20 75 6e 64 65 66 3b | 0d 00 00 00 00 38 00 00 |= undef;|.....8..|
|000041e0| 25 34 00 00 40 f0 49 02 | 1d e6 cf ff 2d 0d d0 ff |%4..@.I.|....-...|
|000041f0| 70 1a 00 00 20 20 20 20 | 24 73 65 6c 66 2d 3e 7b |p... |$self->{|
|00004200| 50 45 45 52 53 7d 20 20 | 3d 20 5b 5d 3b 0d 00 00 |PEERS} |= [];...|
|00004210| 00 34 00 00 25 34 00 00 | 40 60 61 02 3d b7 cf ff |.4..%4..|@`a.=...|
|00004220| 4d de cf ff 70 1a 00 00 | 20 20 20 20 62 6c 65 73 |M...p...| bles|
|00004230| 73 20 28 24 73 65 6c 66 | 2c 20 24 63 6c 61 73 73 |s ($self|, $class|
|00004240| 29 3b 0d 00 00 34 00 00 | 25 2c 00 00 40 70 8e 01 |);...4..|%,..@p..|
|00004250| 5d 88 cf ff 6d af cf ff | 70 1a 00 00 20 20 20 20 |]...m...|p... |
|00004260| 72 65 74 75 72 6e 20 24 | 73 65 6c 66 3b 0d 00 00 |return $|self;...|
|00004270| 00 2c 00 00 a5 44 00 00 | 40 70 17 00 7d 59 cf ff |.,...D..|@p..}Y..|
|00004280| 8d 80 cf ff 70 1a 00 00 | 7d 0d 08 6c 0c 2a 79 00 |....p...|}..l.*y.|
|00004290| 12 28 79 00 00 00 00 00 | 08 73 20 6d 12 00 00 00 |.(y.....|.s m....|
|000042a0| 00 00 00 00 07 74 20 64 | 18 2b 79 00 18 2b 79 00 |.....t d|.+y..+y.|
|000042b0| 00 00 00 00 00 44 00 00 | a5 24 00 00 40 00 00 00 |.....D..|.$..@...|
|000042c0| ed 44 cf ff ad 51 cf ff | 00 00 00 00 0d 08 72 20 |.D...Q..|......r |
|000042d0| 18 2c 79 00 00 00 00 00 | 00 24 00 00 05 88 00 00 |.,y.....|.$......|
|000042e0| 00 f8 ae 07 1d ec ce ff | fd 1a cf ff 20 22 00 00 |........|.... "..|
|000042f0| 54 68 61 74 27 73 20 61 | 62 6f 75 74 20 61 6c 6c |That's a|bout all|
|00004300| 20 74 68 65 72 65 20 69 | 73 20 66 6f 72 20 63 6f | there i|s for co|
|00004310| 6e 73 74 72 75 63 74 6f | 72 73 2e 20 20 54 68 65 |nstructo|rs. The|
|00004320| 73 65 20 6d 65 74 68 6f | 64 73 20 62 72 69 6e 67 |se metho|ds bring|
|00004330| 20 6f 62 6a 65 63 74 73 | 20 74 6f 20 6c 69 66 65 | objects| to life|
|00004340| 2c 20 72 65 74 75 72 6e | 69 6e 67 20 6e 65 61 74 |, return|ing neat|
|00004350| 20 6c 69 74 74 6c 65 20 | 6f 70 61 71 75 65 20 00 | little |opaque .|
|00004360| 00 88 00 00 a5 60 00 00 | 40 8c 3c 04 f6 b3 ce ff |.....`..|@.<.....|
|00004370| d6 e2 ce ff 20 22 00 00 | 62 75 6e 64 6c 65 73 20 |.... "..|bundles |
|00004380| 74 6f 20 74 68 65 20 75 | 73 65 72 20 74 6f 20 62 |to the u|ser to b|
|00004390| 65 20 75 73 65 64 20 69 | 6e 20 73 75 62 73 65 71 |e used i|n subseq|
|000043a0| 75 65 6e 74 20 6d 65 74 | 68 6f 64 20 63 61 6c 6c |uent met|hod call|
|000043b0| 73 2e 0d 07 0a 2d 79 00 | 0a 2d 79 00 00 00 00 00 |s....-y.|.-y.....|
|000043c0| 00 60 00 00 a5 30 00 00 | 40 90 17 01 4f 3d ce ff |.`...0..|@...O=..|
|000043d0| ff 73 ce ff 18 2b 00 00 | 44 65 73 74 72 75 63 74 |.s...+..|Destruct|
|000043e0| 6f 72 73 0d 08 20 69 74 | 0a 2e 79 00 00 00 00 00 |ors.. it|..y.....|
|000043f0| 00 30 00 00 05 84 00 00 | 00 04 97 07 1a e8 cd ff |.0......|........|
|00004400| fa 16 ce ff 20 22 00 00 | 45 76 65 72 79 20 73 74 |.... "..|Every st|
|00004410| 6f 72 79 20 68 61 73 20 | 61 20 62 65 67 69 6e 6e |ory has |a beginn|
|00004420| 69 6e 67 20 61 6e 64 20 | 61 6e 20 65 6e 64 2e 20 |ing and |an end. |
|00004430| 20 54 68 65 20 62 65 67 | 69 6e 6e 69 6e 67 20 6f | The beg|inning o|
|00004440| 66 20 74 68 65 20 6f 62 | 6a 65 63 74 27 73 20 73 |f the ob|ject's s|
|00004450| 74 6f 72 79 20 69 73 20 | 69 74 73 20 63 6f 6e 73 |tory is |its cons|
|00004460| 74 72 75 63 74 6f 72 2c | 20 65 78 70 6c 69 63 69 |tructor,| explici|
|00004470| 74 6c 79 20 00 84 00 00 | 85 98 00 00 00 34 43 07 |tly ....|.....4C.|
|00004480| f3 af cd ff d3 de cd ff | 20 22 00 00 63 61 6c 6c |........| "..call|
|00004490| 65 64 20 77 68 65 6e 20 | 74 68 65 20 6f 62 6a 65 |ed when |the obje|
|000044a0| 63 74 20 63 6f 6d 65 73 | 20 69 6e 74 6f 20 65 78 |ct comes| into ex|
|000044b0| 69 73 74 65 6e 63 65 2e | 20 20 42 75 74 20 74 68 |istence.| But th|
|000044c0| 65 20 65 6e 64 69 6e 67 | 20 6f 66 20 69 74 73 20 |e ending| of its |
|000044d0| 73 74 6f 72 79 20 69 73 | 20 74 68 65 20 07 2e 20 |story is| the .. |
|000044e0| 11 2f 79 00 11 2f 79 00 | 00 00 00 00 64 65 73 74 |./y../y.|....dest|
|000044f0| 72 75 63 74 6f 72 08 61 | 11 00 00 00 00 00 00 00 |ructor.a|........|
|00004500| 2c 20 61 20 6d 65 74 68 | 6f 64 20 00 00 98 00 00 |, a meth|od .....|
|00004510| 05 88 00 00 00 b4 b6 07 | cc 77 cd ff ac a6 cd ff |........|.w......|
|00004520| 20 22 00 00 69 6d 70 6c | 69 63 69 74 6c 79 20 63 | "..impl|icitly c|
|00004530| 61 6c 6c 65 64 20 77 68 | 65 6e 20 61 6e 20 6f 62 |alled wh|en an ob|
|00004540| 6a 65 63 74 20 6c 65 61 | 76 65 73 20 74 68 69 73 |ject lea|ves this|
|00004550| 20 6c 69 66 65 2e 20 20 | 41 6e 79 20 70 65 72 2d | life. |Any per-|
|00004560| 6f 62 6a 65 63 74 20 63 | 6c 65 61 6e 2d 75 70 20 |object c|lean-up |
|00004570| 63 6f 64 65 20 69 73 20 | 70 6c 61 63 65 64 20 69 |code is |placed i|
|00004580| 6e 20 74 68 65 20 64 65 | 73 74 72 75 63 74 6f 72 |n the de|structor|
|00004590| 2c 20 00 00 00 88 00 00 | 25 40 00 00 40 40 1d 03 |, ......|%@..@@..|
|000045a0| a5 3f cd ff 85 6e cd ff | 20 22 00 00 77 68 69 63 |.?...n..| "..whic|
|000045b0| 68 20 6d 75 73 74 20 28 | 69 6e 20 50 65 72 6c 29 |h must (|in Perl)|
|000045c0| 20 62 65 20 63 61 6c 6c | 65 64 20 44 45 53 54 52 | be call|ed DESTR|
|000045d0| 4f 59 2e 0d 00 40 00 00 | 01 10 00 00 00 d0 ee 07 |OY...@..|........|
|000045e0| 00 00 00 00 00 10 00 00 | 02 14 00 00 38 07 00 00 |........|....8...|
|000045f0| 00 00 00 00 00 00 00 00 | 00 14 00 00 05 94 00 00 |........|........|
|00004600| 00 d0 ee 07 bc 45 cb ff | 9c 74 cb ff 20 22 00 00 |.....E..|.t.. "..|
|00004610| 16 00 00 00 b0 fc 07 00 | 00 00 00 00 49 66 20 63 |........|....If c|
|00004620| 6f 6e 73 74 72 75 63 74 | 6f 72 73 20 63 61 6e 20 |onstruct|ors can |
|00004630| 68 61 76 65 20 61 72 62 | 69 74 72 61 72 79 20 6e |have arb|itrary n|
|00004640| 61 6d 65 73 2c 20 74 68 | 65 6e 20 77 68 79 20 6e |ames, th|en why n|
|00004650| 6f 74 20 64 65 73 74 72 | 75 63 74 6f 72 73 3f 20 |ot destr|uctors? |
|00004660| 42 65 63 61 75 73 65 20 | 77 68 69 6c 65 20 61 20 |Because |while a |
|00004670| 63 6f 6e 73 74 72 75 63 | 74 6f 72 20 69 73 20 65 |construc|tor is e|
|00004680| 78 70 6c 69 63 69 74 6c | 79 20 00 00 00 94 00 00 |xplicitl|y ......|
|00004690| 05 84 00 00 00 a4 99 07 | 95 0d cb ff 75 3c cb ff |........|....u<..|
|000046a0| 20 22 00 00 63 61 6c 6c | 65 64 2c 20 61 20 64 65 | "..call|ed, a de|
|000046b0| 73 74 72 75 63 74 6f 72 | 20 69 73 20 6e 6f 74 2e |structor| is not.|
|000046c0| 20 44 65 73 74 72 75 63 | 74 69 6f 6e 20 68 61 70 | Destruc|tion hap|
|000046d0| 70 65 6e 73 20 61 75 74 | 6f 6d 61 74 69 63 61 6c |pens aut|omatical|
|000046e0| 6c 79 20 76 69 61 20 50 | 65 72 6c 27 73 20 67 61 |ly via P|erl's ga|
|000046f0| 72 62 61 67 65 20 63 6f | 6c 6c 65 63 74 69 6f 6e |rbage co|llection|
|00004700| 20 28 47 43 29 20 73 79 | 73 74 65 6d 2c 20 00 00 | (GC) sy|stem, ..|
|00004710| 00 84 00 00 05 84 00 00 | 00 fc c8 07 6e d5 ca ff |........|....n...|
|00004720| 4e 04 cb ff 20 22 00 00 | 77 68 69 63 68 20 69 73 |N... "..|which is|
|00004730| 20 61 20 71 75 69 63 6b | 20 62 75 74 20 73 6f 6d | a quick| but som|
|00004740| 65 77 68 61 74 20 6c 61 | 7a 79 20 72 65 66 65 72 |ewhat la|zy refer|
|00004750| 65 6e 63 65 2d 62 61 73 | 65 64 20 47 43 20 73 79 |ence-bas|ed GC sy|
|00004760| 73 74 65 6d 2e 20 54 6f | 20 6b 6e 6f 77 20 77 68 |stem. To| know wh|
|00004770| 61 74 20 74 6f 20 63 61 | 6c 6c 2c 20 50 65 72 6c |at to ca|ll, Perl|
|00004780| 20 69 6e 73 69 73 74 73 | 20 74 68 61 74 20 74 68 | insists| that th|
|00004790| 65 20 00 00 00 84 00 00 | 05 80 00 00 00 b4 68 07 |e ......|......h.|
|000047a0| 47 9d ca ff 27 cc ca ff | 20 22 00 00 64 65 73 74 |G...'...| "..dest|
|000047b0| 72 75 63 74 6f 72 20 62 | 65 20 6e 61 6d 65 64 20 |ructor b|e named |
|000047c0| 44 45 53 54 52 4f 59 2e | 20 50 65 72 6c 27 73 20 |DESTROY.| Perl's |
|000047d0| 6e 6f 74 69 6f 6e 20 6f | 66 20 74 68 65 20 72 69 |notion o|f the ri|
|000047e0| 67 68 74 20 74 69 6d 65 | 20 74 6f 20 63 61 6c 6c |ght time| to call|
|000047f0| 20 61 20 64 65 73 74 72 | 75 63 74 6f 72 20 69 73 | a destr|uctor is|
|00004800| 20 6e 6f 74 20 77 65 6c | 6c 2d 64 65 66 69 6e 65 | not wel|l-define|
|00004810| 64 20 00 00 00 80 00 00 | 25 6c 00 00 40 38 ec 05 |d ......|%l..@8..|
|00004820| 20 65 ca ff 00 94 ca ff | 20 22 00 00 63 75 72 72 | e......| "..curr|
|00004830| 65 6e 74 6c 79 2c 20 77 | 68 69 63 68 20 69 73 20 |ently, w|hich is |
|00004840| 77 68 79 20 79 6f 75 72 | 20 64 65 73 74 72 75 63 |why your| destruc|
|00004850| 74 6f 72 73 20 73 68 6f | 75 6c 64 20 6e 6f 74 20 |tors sho|uld not |
|00004860| 72 65 6c 79 20 6f 6e 20 | 77 68 65 6e 20 74 68 65 |rely on |when the|
|00004870| 79 20 61 72 65 20 63 61 | 6c 6c 65 64 2e 0d 00 00 |y are ca|lled....|
|00004880| 00 6c 00 00 05 80 00 00 | 00 20 c6 07 49 f6 c9 ff |.l......|. ..I...|
|00004890| 29 25 ca ff 20 22 00 00 | 57 68 79 20 69 73 20 44 |)%.. "..|Why is D|
|000048a0| 45 53 54 52 4f 59 20 69 | 6e 20 61 6c 6c 20 63 61 |ESTROY i|n all ca|
|000048b0| 70 73 3f 20 20 50 65 72 | 6c 20 6f 6e 20 6f 63 63 |ps? Per|l on occ|
|000048c0| 61 73 69 6f 6e 20 75 73 | 65 73 20 70 75 72 65 6c |asion us|es purel|
|000048d0| 79 20 75 70 70 65 72 63 | 61 73 65 20 66 75 6e 63 |y upperc|ase func|
|000048e0| 74 69 6f 6e 20 6e 61 6d | 65 73 20 61 73 20 61 20 |tion nam|es as a |
|000048f0| 63 6f 6e 76 65 6e 74 69 | 6f 6e 20 74 6f 20 00 00 |conventi|on to ..|
|00004900| 00 80 00 00 05 88 00 00 | 00 dc e2 07 22 be c9 ff |........|...."...|
|00004910| 02 ed c9 ff 20 22 00 00 | 69 6e 64 69 63 61 74 65 |.... "..|indicate|
|00004920| 20 74 68 61 74 20 74 68 | 65 20 66 75 6e 63 74 69 | that th|e functi|
|00004930| 6f 6e 20 77 69 6c 6c 20 | 62 65 20 61 75 74 6f 6d |on will |be autom|
|00004940| 61 74 69 63 61 6c 6c 79 | 20 63 61 6c 6c 65 64 20 |atically| called |
|00004950| 62 79 20 50 65 72 6c 20 | 69 6e 20 73 6f 6d 65 20 |by Perl |in some |
|00004960| 77 61 79 2e 20 20 4f 74 | 68 65 72 73 20 74 68 61 |way. Ot|hers tha|
|00004970| 74 20 61 72 65 20 63 61 | 6c 6c 65 64 20 69 6d 70 |t are ca|lled imp|
|00004980| 6c 69 63 69 74 6c 79 20 | 00 88 00 00 a5 98 00 00 |licitly |........|
|00004990| 40 1c ee 07 fb 85 c9 ff | db b4 c9 ff 20 22 00 00 |@.......|.... "..|
|000049a0| 69 6e 63 6c 75 64 65 20 | 42 45 47 49 4e 2c 20 45 |include |BEGIN, E|
|000049b0| 4e 44 2c 20 41 55 54 4f | 4c 4f 41 44 2c 20 70 6c |ND, AUTO|LOAD, pl|
|000049c0| 75 73 20 61 6c 6c 20 6d | 65 74 68 6f 64 73 20 75 |us all m|ethods u|
|000049d0| 73 65 64 20 62 79 20 74 | 69 65 64 20 6f 62 6a 65 |sed by t|ied obje|
|000049e0| 63 74 73 2c 20 64 65 73 | 63 72 69 62 65 64 20 69 |cts, des|cribed i|
|000049f0| 6e 20 74 68 65 20 63 68 | 61 70 74 65 72 20 07 6d |n the ch|apter .m|
|00004a00| 10 30 79 00 10 30 79 00 | 00 00 00 00 70 65 72 6c |.0y..0y.|....perl|
|00004a10| 74 69 65 08 10 00 00 00 | 00 00 00 00 2e 0d 00 00 |tie.....|........|
|00004a20| 00 98 00 00 05 84 00 00 | 00 2c c3 07 24 17 c9 ff |........|.,..$...|
|00004a30| 04 46 c9 ff 20 22 00 00 | 49 6e 20 72 65 61 6c 6c |.F.. "..|In reall|
|00004a40| 79 20 67 6f 6f 64 20 6f | 62 6a 65 63 74 2d 6f 72 |y good o|bject-or|
|00004a50| 69 65 6e 74 65 64 20 70 | 72 6f 67 72 61 6d 6d 69 |iented p|rogrammi|
|00004a60| 6e 67 20 6c 61 6e 67 75 | 61 67 65 73 2c 20 74 68 |ng langu|ages, th|
|00004a70| 65 20 75 73 65 72 20 64 | 6f 65 73 6e 27 74 20 63 |e user d|oesn't c|
|00004a80| 61 72 65 20 77 68 65 6e | 20 74 68 65 20 64 65 73 |are when| the des|
|00004a90| 74 72 75 63 74 6f 72 20 | 69 73 20 63 61 6c 6c 65 |tructor |is calle|
|00004aa0| 64 2e 20 20 00 84 00 00 | 05 80 00 00 00 68 6f 07 |d. ....|.....ho.|
|00004ab0| fd de c8 ff dd 0d c9 ff | 20 22 00 00 49 74 20 6a |........| "..It j|
|00004ac0| 75 73 74 20 68 61 70 70 | 65 6e 73 20 77 68 65 6e |ust happ|ens when|
|00004ad0| 20 69 74 27 73 20 73 75 | 70 70 6f 73 65 64 20 74 | it's su|pposed t|
|00004ae0| 6f 2e 20 20 49 6e 20 6c | 6f 77 2d 6c 65 76 65 6c |o. In l|ow-level|
|00004af0| 20 6c 61 6e 67 75 61 67 | 65 73 20 77 69 74 68 6f | languag|es witho|
|00004b00| 75 74 20 61 6e 79 20 47 | 43 20 61 74 20 61 6c 6c |ut any G|C at all|
|00004b10| 2c 20 74 68 65 72 65 27 | 73 20 6e 6f 20 77 61 79 |, there'|s no way|
|00004b20| 20 74 6f 20 00 80 00 00 | 05 88 00 00 00 88 e8 07 | to ....|........|
|00004b30| d6 a6 c8 ff b6 d5 c8 ff | 20 22 00 00 64 65 70 65 |........| "..depe|
|00004b40| 6e 64 20 6f 6e 20 74 68 | 69 73 20 68 61 70 70 65 |nd on th|is happe|
|00004b50| 6e 69 6e 67 20 61 74 20 | 74 68 65 20 72 69 67 68 |ning at |the righ|
|00004b60| 74 20 74 69 6d 65 2c 20 | 73 6f 20 74 68 65 20 70 |t time, |so the p|
|00004b70| 72 6f 67 72 61 6d 6d 65 | 72 20 6d 75 73 74 20 65 |rogramme|r must e|
|00004b80| 78 70 6c 69 63 69 74 6c | 79 20 63 61 6c 6c 20 74 |xplicitl|y call t|
|00004b90| 68 65 20 64 65 73 74 72 | 75 63 74 6f 72 20 74 6f |he destr|uctor to|
|00004ba0| 20 63 6c 65 61 6e 20 75 | 70 20 00 00 00 88 00 00 | clean u|p ......|
|00004bb0| 05 8c 00 00 00 ec ed 07 | af 6e c8 ff 8f 9d c8 ff |........|.n......|
|00004bc0| 20 22 00 00 6d 65 6d 6f | 72 79 20 61 6e 64 20 73 | "..memo|ry and s|
|00004bd0| 74 61 74 65 2c 20 63 72 | 6f 73 73 69 6e 67 20 74 |tate, cr|ossing t|
|00004be0| 68 65 69 72 20 66 69 6e | 67 65 72 73 20 74 68 61 |heir fin|gers tha|
|00004bf0| 74 20 69 74 27 73 20 74 | 68 65 20 72 69 67 68 74 |t it's t|he right|
|00004c00| 20 74 69 6d 65 20 74 6f | 20 64 6f 20 73 6f 2e 20 | time to| do so. |
|00004c10| 20 20 55 6e 6c 69 6b 65 | 20 43 2b 2b 2c 20 61 6e | Unlike| C++, an|
|00004c20| 20 6f 62 6a 65 63 74 20 | 64 65 73 74 72 75 63 74 | object |destruct|
|00004c30| 6f 72 20 69 73 20 00 00 | 00 8c 00 00 05 84 00 00 |or is ..|........|
|00004c40| 00 c8 75 07 88 36 c8 ff | 68 65 c8 ff 20 22 00 00 |..u..6..|he.. "..|
|00004c50| 6e 65 61 72 6c 79 20 6e | 65 76 65 72 20 6e 65 65 |nearly n|ever nee|
|00004c60| 64 65 64 20 69 6e 20 50 | 65 72 6c 2c 20 61 6e 64 |ded in P|erl, and|
|00004c70| 20 65 76 65 6e 20 77 68 | 65 6e 20 69 74 20 69 73 | even wh|en it is|
|00004c80| 2c 20 65 78 70 6c 69 63 | 69 74 20 69 6e 76 6f 63 |, explic|it invoc|
|00004c90| 61 74 69 6f 6e 20 69 73 | 20 75 6e 63 61 6c 6c 65 |ation is| uncalle|
|00004ca0| 64 20 66 6f 72 2e 20 20 | 49 6e 20 74 68 65 20 63 |d for. |In the c|
|00004cb0| 61 73 65 20 6f 66 20 6f | 75 72 20 00 00 84 00 00 |ase of o|ur .....|
|00004cc0| a5 94 00 00 40 d8 ec 07 | 61 fe c7 ff 41 2d c8 ff |....@...|a...A-..|
|00004cd0| 20 22 00 00 50 65 72 73 | 6f 6e 20 63 6c 61 73 73 | "..Pers|on class|
|00004ce0| 2c 20 77 65 20 64 6f 6e | 27 74 20 6e 65 65 64 20 |, we don|'t need |
|00004cf0| 61 20 64 65 73 74 72 75 | 63 74 6f 72 20 62 65 63 |a destru|ctor bec|
|00004d00| 61 75 73 65 20 50 65 72 | 6c 20 74 61 6b 65 73 20 |ause Per|l takes |
|00004d10| 63 61 72 65 20 6f 66 20 | 73 69 6d 70 6c 65 20 6d |care of |simple m|
|00004d20| 61 74 74 65 72 73 20 6c | 69 6b 65 20 6d 65 6d 6f |atters l|ike memo|
|00004d30| 72 79 20 64 65 61 6c 6c | 6f 63 61 74 69 6f 6e 2e |ry deall|ocation.|
|00004d40| 0d 07 00 00 14 31 79 00 | 14 31 79 00 00 00 00 00 |.....1y.|.1y.....|
|00004d50| 00 94 00 00 05 80 00 00 | 00 b4 80 07 8a 8f c7 ff |........|........|
|00004d60| 6a be c7 ff 20 22 00 00 | 54 68 65 20 6f 6e 6c 79 |j... "..|The only|
|00004d70| 20 73 69 74 75 61 74 69 | 6f 6e 20 77 68 65 72 65 | situati|on where|
|00004d80| 20 50 65 72 6c 27 73 20 | 72 65 66 65 72 65 6e 63 | Perl's |referenc|
|00004d90| 65 2d 62 61 73 65 64 20 | 47 43 20 77 6f 6e 27 74 |e-based |GC won't|
|00004da0| 20 77 6f 72 6b 20 69 73 | 20 77 68 65 6e 20 74 68 | work is| when th|
|00004db0| 65 72 65 27 73 20 61 20 | 63 69 72 63 75 6c 61 72 |ere's a |circular|
|00004dc0| 69 74 79 20 69 6e 20 74 | 68 65 20 64 61 74 61 20 |ity in t|he data |
|00004dd0| 00 80 00 00 a5 5c 00 00 | 40 2c 51 01 63 57 c7 ff |.....\..|@,Q.cW..|
|00004de0| 43 86 c7 ff 20 22 00 00 | 73 74 72 75 63 74 75 72 |C... "..|structur|
|00004df0| 65 2c 20 73 75 63 68 20 | 61 73 3a 0d 08 20 54 68 |e, such |as:.. Th|
|00004e00| 14 00 00 00 00 00 00 00 | 07 63 65 20 12 32 79 00 |........|.ce .2y.|
|00004e10| 12 32 79 00 00 00 00 00 | 07 61 6e 64 0c 33 79 00 |.2y.....|.and.3y.|
|00004e20| 12 32 79 00 0c 33 79 00 | 00 00 00 00 00 5c 00 00 |.2y..3y.|.....\..|
|00004e30| a5 5c 00 00 40 60 61 02 | 5c f0 c6 ff 6c 17 c7 ff |.\..@`a.|\...l...|
|00004e40| 70 1a 00 00 24 74 68 69 | 73 2d 3e 7b 57 48 41 54 |p...$thi|s->{WHAT|
|00004e50| 45 56 45 52 7d 20 3d 20 | 24 74 68 69 73 3b 0d 08 |EVER} = |$this;..|
|00004e60| 0c 34 79 00 12 32 79 00 | 00 00 00 00 08 75 6c 64 |.4y..2y.|.....uld|
|00004e70| 12 00 00 00 00 00 00 00 | 07 79 20 77 18 35 79 00 |........|.y w.5y.|
|00004e80| 18 35 79 00 00 00 00 00 | 00 5c 00 00 a5 24 00 00 |.5y.....|.\...$..|
|00004e90| 40 00 00 00 cc db c6 ff | 8c e8 c6 ff 00 00 00 00 |@.......|........|
|00004ea0| 0d 08 6e 73 18 36 79 00 | 00 00 00 00 00 24 00 00 |..ns.6y.|.....$..|
|00004eb0| 05 84 00 00 00 2c b1 07 | fc 82 c6 ff dc b1 c6 ff |.....,..|........|
|00004ec0| 20 22 00 00 49 6e 20 74 | 68 61 74 20 63 61 73 65 | "..In t|hat case|
|00004ed0| 2c 20 79 6f 75 20 6d 75 | 73 74 20 64 65 6c 65 74 |, you mu|st delet|
|00004ee0| 65 20 74 68 65 20 73 65 | 6c 66 2d 72 65 66 65 72 |e the se|lf-refer|
|00004ef0| 65 6e 63 65 20 6d 61 6e | 75 61 6c 6c 79 20 69 66 |ence man|ually if|
|00004f00| 20 79 6f 75 20 65 78 70 | 65 63 74 20 79 6f 75 72 | you exp|ect your|
|00004f10| 20 70 72 6f 67 72 61 6d | 20 6e 6f 74 20 74 6f 20 | program| not to |
|00004f20| 6c 65 61 6b 20 6d 65 6d | 6f 72 79 2e 20 20 00 00 |leak mem|ory. ..|
|00004f30| 00 84 00 00 05 88 00 00 | 00 70 f1 07 d5 4a c6 ff |........|.p...J..|
|00004f40| b5 79 c6 ff 20 22 00 00 | 57 68 69 6c 65 20 61 64 |.y.. "..|While ad|
|00004f50| 6d 69 74 74 65 64 6c 79 | 20 65 72 72 6f 72 2d 70 |mittedly| error-p|
|00004f60| 72 6f 6e 65 2c 20 74 68 | 69 73 20 69 73 20 74 68 |rone, th|is is th|
|00004f70| 65 20 62 65 73 74 20 77 | 65 20 63 61 6e 20 64 6f |e best w|e can do|
|00004f80| 20 72 69 67 68 74 20 6e | 6f 77 2e 20 20 4e 6f 6e | right n|ow. Non|
|00004f90| 65 74 68 65 6c 65 73 73 | 2c 20 72 65 73 74 20 61 |etheless|, rest a|
|00004fa0| 73 73 75 72 65 64 20 74 | 68 61 74 20 77 68 65 6e |ssured t|hat when|
|00004fb0| 20 79 6f 75 72 20 00 00 | 00 88 00 00 85 90 00 00 | your ..|........|
|00004fc0| 00 78 3e 07 ae 12 c6 ff | 8e 41 c6 ff 20 22 00 00 |.x>.....|.A.. "..|
|00004fd0| 70 72 6f 67 72 61 6d 20 | 69 73 20 66 69 6e 69 73 |program |is finis|
|00004fe0| 68 65 64 2c 20 69 74 73 | 20 6f 62 6a 65 63 74 73 |hed, its| objects|
|00004ff0| 27 20 64 65 73 74 72 75 | 63 74 6f 72 73 20 61 72 |' destru|ctors ar|
|00005000| 65 20 61 6c 6c 20 64 75 | 6c 79 20 63 61 6c 6c 65 |e all du|ly calle|
|00005010| 64 2e 20 53 6f 20 79 6f | 75 20 61 72 65 20 67 75 |d. So yo|u are gu|
|00005020| 61 72 61 6e 74 65 65 64 | 20 74 68 61 74 20 61 6e |aranteed| that an|
|00005030| 20 6f 62 6a 65 63 74 20 | 07 70 65 65 11 37 79 00 | object |.pee.7y.|
|00005040| 11 37 79 00 00 00 00 00 | 00 90 00 00 85 8c 00 00 |.7y.....|........|
|00005050| 00 2c 60 07 87 da c5 ff | 67 09 c6 ff f8 22 00 00 |.,`.....|g...."..|
|00005060| 65 76 65 6e 74 75 61 6c | 6c 79 08 75 11 00 00 00 |eventual|ly.u....|
|00005070| 00 00 00 00 20 67 65 74 | 73 20 70 72 6f 70 65 72 |.... get|s proper|
|00005080| 6c 79 20 64 65 73 74 72 | 6f 79 65 64 2c 20 65 78 |ly destr|oyed, ex|
|00005090| 63 65 70 74 20 69 6e 20 | 74 68 65 20 75 6e 69 71 |cept in |the uniq|
|000050a0| 75 65 20 63 61 73 65 20 | 6f 66 20 61 20 70 72 6f |ue case |of a pro|
|000050b0| 67 72 61 6d 20 74 68 61 | 74 20 6e 65 76 65 72 20 |gram tha|t never |
|000050c0| 65 78 69 74 73 2e 20 28 | 49 66 20 79 6f 75 27 72 |exits. (|If you'r|
|000050d0| 65 20 00 00 00 8c 00 00 | 05 84 00 00 00 ac dc 07 |e ......|........|
|000050e0| 60 a2 c5 ff 40 d1 c5 ff | 20 22 00 00 72 75 6e 6e |`...@...| "..runn|
|000050f0| 69 6e 67 20 50 65 72 6c | 20 65 6d 62 65 64 64 65 |ing Perl| embedde|
|00005100| 64 20 69 6e 20 61 6e 6f | 74 68 65 72 20 61 70 70 |d in ano|ther app|
|00005110| 6c 69 63 61 74 69 6f 6e | 2c 20 74 68 69 73 20 66 |lication|, this f|
|00005120| 75 6c 6c 20 47 43 20 70 | 61 73 73 20 68 61 70 70 |ull GC p|ass happ|
|00005130| 65 6e 73 20 61 20 62 69 | 74 20 6d 6f 72 65 20 66 |ens a bi|t more f|
|00005140| 72 65 71 75 65 6e 74 6c | 79 2d 2d 77 68 65 6e 65 |requentl|y--whene|
|00005150| 76 65 72 20 61 20 00 00 | 00 84 00 00 a5 3c 00 00 |ver a ..|.....<..|
|00005160| 40 70 70 01 39 6a c5 ff | 19 99 c5 ff 20 22 00 00 |@pp.9j..|.... "..|
|00005170| 74 68 72 65 61 64 20 73 | 68 75 74 73 20 64 6f 77 |thread s|huts dow|
|00005180| 6e 2e 29 0d 07 23 23 23 | 0a 38 79 00 0a 38 79 00 |n.)..###|.8y..8y.|
|00005190| 00 00 00 00 00 3c 00 00 | a5 38 00 00 40 f4 16 02 |.....<..|.8..@...|
|000051a0| 92 f3 c4 ff 42 2a c5 ff | 18 2b 00 00 4f 74 68 65 |....B*..|.+..Othe|
|000051b0| 72 20 4f 62 6a 65 63 74 | 20 4d 65 74 68 6f 64 73 |r Object| Methods|
|000051c0| 0d 08 24 73 0a 39 79 00 | 00 00 00 00 00 38 00 00 |..$s.9y.|.....8..|
|000051d0| 05 7c 00 00 00 08 48 07 | 5d 9e c4 ff 3d cd c4 ff |.|....H.|]...=...|
|000051e0| 20 22 00 00 54 68 65 20 | 6d 65 74 68 6f 64 73 20 | "..The |methods |
|000051f0| 77 65 27 76 65 20 74 61 | 6c 6b 65 64 20 61 62 6f |we've ta|lked abo|
|00005200| 75 74 20 73 6f 20 66 61 | 72 20 68 61 76 65 20 65 |ut so fa|r have e|
|00005210| 69 74 68 65 72 20 62 65 | 65 6e 20 63 6f 6e 73 74 |ither be|en const|
|00005220| 72 75 63 74 6f 72 73 20 | 6f 72 20 65 6c 73 65 20 |ructors |or else |
|00005230| 73 69 6d 70 6c 65 20 22 | 64 61 74 61 20 6d 65 74 |simple "|data met|
|00005240| 68 6f 64 73 22 2c 20 00 | 00 7c 00 00 05 88 00 00 |hods", .|.|......|
|00005250| 00 6c ef 07 36 66 c4 ff | 16 95 c4 ff 20 22 00 00 |.l..6f..|.... "..|
|00005260| 69 6e 74 65 72 66 61 63 | 65 73 20 74 6f 20 64 61 |interfac|es to da|
|00005270| 74 61 20 73 74 6f 72 65 | 64 20 69 6e 20 74 68 65 |ta store|d in the|
|00005280| 20 6f 62 6a 65 63 74 2e | 20 54 68 65 73 65 20 61 | object.| These a|
|00005290| 72 65 20 61 20 62 69 74 | 20 6c 69 6b 65 20 61 6e |re a bit| like an|
|000052a0| 20 6f 62 6a 65 63 74 27 | 73 20 64 61 74 61 20 6d | object'|s data m|
|000052b0| 65 6d 62 65 72 73 20 69 | 6e 20 74 68 65 20 43 2b |embers i|n the C+|
|000052c0| 2b 20 77 6f 72 6c 64 2c | 20 65 78 63 65 70 74 20 |+ world,| except |
|000052d0| 00 88 00 00 05 8c 00 00 | 00 54 ce 07 0f 2e c4 ff |........|.T......|
|000052e0| ef 5c c4 ff 20 22 00 00 | 74 68 61 74 20 73 74 72 |.\.. "..|that str|
|000052f0| 61 6e 67 65 72 73 20 64 | 6f 6e 27 74 20 61 63 63 |angers d|on't acc|
|00005300| 65 73 73 20 74 68 65 6d | 20 61 73 20 64 61 74 61 |ess them| as data|
|00005310| 2e 20 20 49 6e 73 74 65 | 61 64 2c 20 74 68 65 79 |. Inste|ad, they|
|00005320| 20 73 68 6f 75 6c 64 20 | 6f 6e 6c 79 20 61 63 63 | should |only acc|
|00005330| 65 73 73 20 74 68 65 20 | 6f 62 6a 65 63 74 27 73 |ess the |object's|
|00005340| 20 64 61 74 61 20 69 6e | 64 69 72 65 63 74 6c 79 | data in|directly|
|00005350| 20 76 69 61 20 69 74 73 | 20 00 00 00 00 8c 00 00 | via its| .......|
|00005360| a5 a4 00 00 40 dc ee 07 | e8 f5 c3 ff c8 24 c4 ff |....@...|.....$..|
|00005370| 20 22 00 00 6d 65 74 68 | 6f 64 73 2e 20 20 54 68 | "..meth|ods. Th|
|00005380| 69 73 20 69 73 20 61 6e | 20 69 6d 70 6f 72 74 61 |is is an| importa|
|00005390| 6e 74 20 72 75 6c 65 3a | 20 69 6e 20 50 65 72 6c |nt rule:| in Perl|
|000053a0| 2c 20 61 63 63 65 73 73 | 20 74 6f 20 61 6e 20 6f |, access| to an o|
|000053b0| 62 6a 65 63 74 27 73 20 | 64 61 74 61 20 73 68 6f |bject's |data sho|
|000053c0| 75 6c 64 20 07 20 6d 65 | 11 3a 79 00 11 3a 79 00 |uld . me|.:y..:y.|
|000053d0| 00 00 00 00 6f 6e 6c 79 | 08 2c 20 50 11 00 00 00 |....only|., P....|
|000053e0| 00 00 00 00 20 62 65 20 | 6d 61 64 65 20 74 68 72 |.... be |made thr|
|000053f0| 6f 75 67 68 20 6d 65 74 | 68 6f 64 73 2e 0d 00 00 |ough met|hods....|
|00005400| 00 a4 00 00 05 84 00 00 | 00 f4 d0 07 11 87 c3 ff |........|........|
|00005410| f1 b5 c3 ff 20 22 00 00 | 50 65 72 6c 20 64 6f 65 |.... "..|Perl doe|
|00005420| 73 6e 27 74 20 69 6d 70 | 6f 73 65 20 72 65 73 74 |sn't imp|ose rest|
|00005430| 72 69 63 74 69 6f 6e 73 | 20 6f 6e 20 77 68 6f 20 |rictions| on who |
|00005440| 67 65 74 73 20 74 6f 20 | 75 73 65 20 77 68 69 63 |gets to |use whic|
|00005450| 68 20 6d 65 74 68 6f 64 | 73 2e 20 54 68 65 20 70 |h method|s. The p|
|00005460| 75 62 6c 69 63 2d 76 65 | 72 73 75 73 2d 70 72 69 |ublic-ve|rsus-pri|
|00005470| 76 61 74 65 20 64 69 73 | 74 69 6e 63 74 69 6f 6e |vate dis|tinction|
|00005480| 20 69 73 20 00 84 00 00 | 05 84 00 00 00 58 ca 07 | is ....|.....X..|
|00005490| ea 4e c3 ff ca 7d c3 ff | 20 22 00 00 62 79 20 63 |.N...}..| "..by c|
|000054a0| 6f 6e 76 65 6e 74 69 6f | 6e 2c 20 6e 6f 74 20 73 |onventio|n, not s|
|000054b0| 79 6e 74 61 78 2e 20 28 | 57 65 6c 6c 2c 20 75 6e |yntax. (|Well, un|
|000054c0| 6c 65 73 73 20 79 6f 75 | 20 75 73 65 20 74 68 65 |less you| use the|
|000054d0| 20 41 6c 69 61 73 20 6d | 6f 64 75 6c 65 20 64 65 | Alias m|odule de|
|000054e0| 73 63 72 69 62 65 64 20 | 62 65 6c 6f 77 20 69 6e |scribed |below in|
|000054f0| 20 74 68 65 20 73 65 63 | 74 69 6f 6e 20 6f 6e 20 | the sec|tion on |
|00005500| 22 44 61 74 61 20 00 00 | 00 84 00 00 05 80 00 00 |"Data ..|........|
|00005510| 00 20 d8 07 c3 16 c3 ff | a3 45 c3 ff 20 22 00 00 |. ......|.E.. "..|
|00005520| 4d 65 6d 62 65 72 73 20 | 61 73 20 56 61 72 69 61 |Members |as Varia|
|00005530| 62 6c 65 73 22 2e 29 20 | 20 4f 63 63 61 73 69 6f |bles".) | Occasio|
|00005540| 6e 61 6c 6c 79 20 79 6f | 75 27 6c 6c 20 73 65 65 |nally yo|u'll see|
|00005550| 20 6d 65 74 68 6f 64 20 | 6e 61 6d 65 73 20 62 65 | method |names be|
|00005560| 67 69 6e 6e 69 6e 67 20 | 6f 72 20 65 6e 64 69 6e |ginning |or endin|
|00005570| 67 20 77 69 74 68 20 61 | 6e 20 75 6e 64 65 72 73 |g with a|n unders|
|00005580| 63 6f 72 65 20 6f 72 20 | 00 80 00 00 05 88 00 00 |core or |........|
|00005590| 00 1c e5 07 9c de c2 ff | 7c 0d c3 ff 20 22 00 00 |........||... "..|
|000055a0| 74 77 6f 2e 20 20 54 68 | 69 73 20 6d 61 72 6b 69 |two. Th|is marki|
|000055b0| 6e 67 20 69 73 20 61 20 | 63 6f 6e 76 65 6e 74 69 |ng is a |conventi|
|000055c0| 6f 6e 20 69 6e 64 69 63 | 61 74 69 6e 67 20 74 68 |on indic|ating th|
|000055d0| 61 74 20 74 68 65 20 6d | 65 74 68 6f 64 73 20 61 |at the m|ethods a|
|000055e0| 72 65 20 70 72 69 76 61 | 74 65 20 74 6f 20 74 68 |re priva|te to th|
|000055f0| 61 74 20 63 6c 61 73 73 | 20 61 6c 6f 6e 65 20 61 |at class| alone a|
|00005600| 6e 64 20 73 6f 6d 65 74 | 69 6d 65 73 20 00 00 00 |nd somet|imes ...|
|00005610| 00 88 00 00 05 8c 00 00 | 00 e0 de 07 75 a6 c2 ff |........|....u...|
|00005620| 55 d5 c2 ff 20 22 00 00 | 74 6f 20 69 74 73 20 63 |U... "..|to its c|
|00005630| 6c 6f 73 65 73 74 20 61 | 63 71 75 61 69 6e 74 61 |losest a|cquainta|
|00005640| 6e 63 65 73 2c 20 69 74 | 73 20 69 6d 6d 65 64 69 |nces, it|s immedi|
|00005650| 61 74 65 20 73 75 62 63 | 6c 61 73 73 65 73 2e 20 |ate subc|lasses. |
|00005660| 20 42 75 74 20 74 68 69 | 73 20 64 69 73 74 69 6e | But thi|s distin|
|00005670| 63 74 69 6f 6e 20 69 73 | 20 6e 6f 74 20 65 6e 66 |ction is| not enf|
|00005680| 6f 72 63 65 64 20 62 79 | 20 50 65 72 6c 20 69 74 |orced by| Perl it|
|00005690| 73 65 6c 66 2e 20 20 49 | 74 27 73 20 00 8c 00 00 |self. I|t's ....|
|000056a0| 25 38 00 00 40 dc 63 02 | 4e 6e c2 ff 2e 9d c2 ff |%8..@.c.|Nn......|
|000056b0| 20 22 00 00 75 70 20 74 | 6f 20 74 68 65 20 70 72 | "..up t|o the pr|
|000056c0| 6f 67 72 61 6d 6d 65 72 | 20 74 6f 20 62 65 68 61 |ogrammer| to beha|
|000056d0| 76 65 2e 0d 00 38 00 00 | 05 84 00 00 00 3c a7 07 |ve...8..|.....<..|
|000056e0| 77 ff c1 ff 57 2e c2 ff | 20 22 00 00 54 68 65 72 |w...W...| "..Ther|
|000056f0| 65 27 73 20 6e 6f 20 72 | 65 61 73 6f 6e 20 74 6f |e's no r|eason to|
|00005700| 20 6c 69 6d 69 74 20 6d | 65 74 68 6f 64 73 20 74 | limit m|ethods t|
|00005710| 6f 20 74 68 6f 73 65 20 | 74 68 61 74 20 73 69 6d |o those |that sim|
|00005720| 70 6c 79 20 61 63 63 65 | 73 73 20 64 61 74 61 2e |ply acce|ss data.|
|00005730| 20 4d 65 74 68 6f 64 73 | 20 63 61 6e 20 64 6f 20 | Methods| can do |
|00005740| 61 6e 79 74 68 69 6e 67 | 20 61 74 20 61 6c 6c 2e |anything| at all.|
|00005750| 20 20 54 68 65 20 00 00 | 00 84 00 00 05 84 00 00 | The ..|........|
|00005760| 00 08 8a 07 50 c7 c1 ff | 30 f6 c1 ff 20 22 00 00 |....P...|0... "..|
|00005770| 6b 65 79 20 70 6f 69 6e | 74 20 69 73 20 74 68 61 |key poin|t is tha|
|00005780| 74 20 74 68 65 79 27 72 | 65 20 69 6e 76 6f 6b 65 |t they'r|e invoke|
|00005790| 64 20 61 67 61 69 6e 73 | 74 20 61 6e 20 6f 62 6a |d agains|t an obj|
|000057a0| 65 63 74 20 6f 72 20 61 | 20 63 6c 61 73 73 2e 20 |ect or a| class. |
|000057b0| 20 4c 65 74 27 73 20 73 | 61 79 20 77 65 27 64 20 | Let's s|ay we'd |
|000057c0| 6c 69 6b 65 20 6f 62 6a | 65 63 74 20 6d 65 74 68 |like obj|ect meth|
|000057d0| 6f 64 73 20 74 68 61 74 | 20 64 6f 20 00 84 00 00 |ods that| do ....|
|000057e0| a5 68 00 00 40 dc 14 03 | 29 8f c1 ff 09 be c1 ff |.h..@...|).......|
|000057f0| 20 22 00 00 6d 6f 72 65 | 20 74 68 61 6e 20 66 65 | "..more| than fe|
|00005800| 74 63 68 20 6f 72 20 73 | 65 74 20 6f 6e 65 20 70 |tch or s|et one p|
|00005810| 61 72 74 69 63 75 6c 61 | 72 20 66 69 65 6c 64 2e |articula|r field.|
|00005820| 0d 07 65 6e 12 3b 79 00 | 12 3b 79 00 00 00 00 00 |..en.;y.|.;y.....|
|00005830| 07 69 73 20 0c 3c 79 00 | 12 3b 79 00 0c 3c 79 00 |.is .<y.|.;y..<y.|
|00005840| 00 00 00 00 00 68 00 00 | 25 28 00 00 40 b0 30 01 |.....h..|%(..@.0.|
|00005850| 22 28 c1 ff 32 4f c1 ff | 70 1a 00 00 73 75 62 20 |"(..2O..|p...sub |
|00005860| 65 78 63 6c 61 69 6d 20 | 7b 0d 00 00 00 28 00 00 |exclaim |{....(..|
|00005870| 25 30 00 00 40 30 ec 01 | 42 f9 c0 ff 52 20 c1 ff |%0..@0..|B...R ..|
|00005880| 70 1a 00 00 20 20 20 20 | 6d 79 20 24 73 65 6c 66 |p... |my $self|
|00005890| 20 3d 20 73 68 69 66 74 | 3b 0d 00 00 00 30 00 00 | = shift|;....0..|
|000058a0| 25 54 00 00 40 f0 37 05 | 62 ca c0 ff 72 f1 c0 ff |%T..@.7.|b...r...|
|000058b0| 70 1a 00 00 20 20 20 20 | 72 65 74 75 72 6e 20 73 |p... |return s|
|000058c0| 70 72 69 6e 74 66 20 22 | 48 69 2c 20 49 27 6d 20 |printf "|Hi, I'm |
|000058d0| 25 73 2c 20 61 67 65 20 | 25 64 2c 20 77 6f 72 6b |%s, age |%d, work|
|000058e0| 69 6e 67 20 77 69 74 68 | 20 25 73 22 2c 0d 00 00 |ing with| %s",...|
|000058f0| 00 54 00 00 25 5c 00 00 | 40 00 dc 05 82 9b c0 ff |.T..%\..|@.......|
|00005900| 92 c2 c0 ff 70 1a 00 00 | 20 20 20 20 20 20 20 20 |....p...| |
|00005910| 24 73 65 6c 66 2d 3e 7b | 4e 41 4d 45 7d 2c 20 24 |$self->{|NAME}, $|
|00005920| 73 65 6c 66 2d 3e 7b 41 | 47 45 7d 2c 20 6a 6f 69 |self->{A|GE}, joi|
|00005930| 6e 28 22 2c 20 22 2c 20 | 24 73 65 6c 66 2d 3e 7b |n(", ", |$self->{|
|00005940| 50 45 45 52 53 7d 29 3b | 0d 00 00 00 00 5c 00 00 |PEERS});|.....\..|
|00005950| a5 44 00 00 40 70 17 00 | a2 6c c0 ff b2 93 c0 ff |.D..@p..|.l......|
|00005960| 70 1a 00 00 7d 0d 08 68 | 0c 3d 79 00 12 3b 79 00 |p...}..h|.=y..;y.|
|00005970| 00 00 00 00 08 20 77 69 | 12 00 00 00 00 00 00 00 |..... wi|........|
|00005980| 07 73 73 65 18 3e 79 00 | 18 3e 79 00 00 00 00 00 |.sse.>y.|.>y.....|
|00005990| 00 44 00 00 a5 34 00 00 | 40 00 00 00 12 58 c0 ff |.D...4..|@....X..|
|000059a0| d2 64 c0 ff 00 00 00 00 | 0d 08 00 00 18 3f 79 00 |.d......|.....?y.|
|000059b0| 00 00 00 00 07 73 20 70 | 14 40 79 00 14 40 79 00 |.....s p|.@y..@y.|
|000059c0| 00 00 00 00 00 34 00 00 | 01 10 00 00 41 48 1c 02 |.....4..|....AH..|
|000059d0| 00 00 00 00 00 10 00 00 | 02 18 00 00 d4 08 00 00 |........|........|
|000059e0| 00 00 00 00 14 40 79 00 | 00 00 00 00 00 18 00 00 |.....@y.|........|
|000059f0| a5 70 00 00 40 48 1c 02 | 0b 46 be ff eb 74 be ff |.p..@H..|.F...t..|
|00005a00| 20 22 00 00 16 00 00 00 | b0 fc 07 00 00 00 00 00 | "......|........|
|00005a10| 4f 72 20 6d 61 79 62 65 | 20 65 76 65 6e 20 6f 6e |Or maybe| even on|
|00005a20| 65 20 6c 69 6b 65 20 74 | 68 69 73 3a 0d 08 00 00 |e like t|his:....|
|00005a30| 14 00 00 00 00 00 00 00 | 07 dd 5f f4 12 41 79 00 |........|.._..Ay.|
|00005a40| 12 41 79 00 00 00 00 00 | 07 7e 83 f4 0c 42 79 00 |.Ay.....|.~...By.|
|00005a50| 12 41 79 00 0c 42 79 00 | 00 00 00 00 00 70 00 00 |.Ay..By.|.....p..|
|00005a60| 25 30 00 00 40 c0 d4 01 | 04 df bd ff 14 06 be ff |%0..@...|........|
|00005a70| 70 1a 00 00 73 75 62 20 | 68 61 70 70 79 5f 62 69 |p...sub |happy_bi|
|00005a80| 72 74 68 64 61 79 20 7b | 0d 00 00 00 00 30 00 00 |rthday {|.....0..|
|00005a90| 25 30 00 00 40 30 ec 01 | 24 b0 bd ff 34 d7 bd ff |%0..@0..|$...4...|
|00005aa0| 70 1a 00 00 20 20 20 20 | 6d 79 20 24 73 65 6c 66 |p... |my $self|
|00005ab0| 20 3d 20 73 68 69 66 74 | 3b 0d 00 00 00 30 00 00 | = shift|;....0..|
|00005ac0| 25 34 00 00 40 60 61 02 | 44 81 bd ff 54 a8 bd ff |%4..@`a.|D...T...|
|00005ad0| 70 1a 00 00 20 20 20 20 | 72 65 74 75 72 6e 20 2b |p... |return +|
|00005ae0| 2b 24 73 65 6c 66 2d 3e | 7b 41 47 45 7d 3b 0d 00 |+$self->|{AGE};..|
|00005af0| 00 34 00 00 a5 44 00 00 | 40 70 17 00 64 52 bd ff |.4...D..|@p..dR..|
|00005b00| 74 79 bd ff 70 1a 00 00 | 7d 0d 08 20 0c 43 79 00 |ty..p...|}.. .Cy.|
|00005b10| 12 41 79 00 00 00 00 00 | 08 63 61 6e 12 00 00 00 |.Ay.....|.can....|
|00005b20| 00 00 00 00 07 00 00 00 | 18 44 79 00 18 44 79 00 |........|.Dy..Dy.|
|00005b30| 00 00 00 00 00 44 00 00 | a5 34 00 00 40 00 00 00 |.....D..|.4..@...|
|00005b40| d4 3d bd ff 94 4a bd ff | 00 00 00 00 0d 08 69 6f |.=...J..|......io|
|00005b50| 18 45 79 00 00 00 00 00 | 07 66 61 63 14 46 79 00 |.Ey.....|.fac.Fy.|
|00005b60| 14 46 79 00 00 00 00 00 | 00 34 00 00 a5 7c 00 00 |.Fy.....|.4...|..|
|00005b70| 40 90 0b 04 04 e5 bc ff | e4 13 bd ff 20 22 00 00 |@.......|.... "..|
|00005b80| 53 6f 6d 65 20 6d 69 67 | 68 74 20 61 72 67 75 65 |Some mig|ht argue|
|00005b90| 20 74 68 61 74 20 6f 6e | 65 20 73 68 6f 75 6c 64 | that on|e should|
|00005ba0| 20 67 6f 20 61 74 20 74 | 68 65 73 65 20 74 68 69 | go at t|hese thi|
|00005bb0| 73 20 77 61 79 3a 0d 08 | 14 00 00 00 00 00 00 00 |s way:..|........|
|00005bc0| 07 61 63 65 12 47 79 00 | 12 47 79 00 00 00 00 00 |.ace.Gy.|.Gy.....|
|00005bd0| 07 20 61 6e 0c 48 79 00 | 12 47 79 00 0c 48 79 00 |. an.Hy.|.Gy..Hy.|
|00005be0| 00 00 00 00 00 7c 00 00 | 25 28 00 00 40 b0 30 01 |.....|..|%(..@.0.|
|00005bf0| fd 7d bc ff 0d a5 bc ff | 70 1a 00 00 73 75 62 20 |.}......|p...sub |
|00005c00| 65 78 63 6c 61 69 6d 20 | 7b 0d 00 00 00 28 00 00 |exclaim |{....(..|
|00005c10| 25 30 00 00 40 30 ec 01 | 1d 4f bc ff 2d 76 bc ff |%0..@0..|.O..-v..|
|00005c20| 70 1a 00 00 20 20 20 20 | 6d 79 20 24 73 65 6c 66 |p... |my $self|
|00005c30| 20 3d 20 73 68 69 66 74 | 3b 0d 00 00 00 30 00 00 | = shift|;....0..|
|00005c40| 25 54 00 00 40 f0 37 05 | 3d 20 bc ff 4d 47 bc ff |%T..@.7.|= ..MG..|
|00005c50| 70 1a 00 00 20 20 20 20 | 72 65 74 75 72 6e 20 73 |p... |return s|
|00005c60| 70 72 69 6e 74 66 20 22 | 48 69 2c 20 49 27 6d 20 |printf "|Hi, I'm |
|00005c70| 25 73 2c 20 61 67 65 20 | 25 64 2c 20 77 6f 72 6b |%s, age |%d, work|
|00005c80| 69 6e 67 20 77 69 74 68 | 20 25 73 22 2c 0d 00 00 |ing with| %s",...|
|00005c90| 00 54 00 00 25 54 00 00 | 40 60 4f 05 5d f1 bb ff |.T..%T..|@`O.]...|
|00005ca0| 6d 18 bc ff 70 1a 00 00 | 20 20 20 20 20 20 20 20 |m...p...| |
|00005cb0| 24 73 65 6c 66 2d 3e 6e | 61 6d 65 2c 20 24 73 65 |$self->n|ame, $se|
|00005cc0| 6c 66 2d 3e 61 67 65 2c | 20 6a 6f 69 6e 28 22 2c |lf->age,| join(",|
|00005cd0| 20 22 2c 20 24 73 65 6c | 66 2d 3e 70 65 65 72 73 | ", $sel|f->peers|
|00005ce0| 29 3b 0d 00 00 54 00 00 | a5 44 00 00 40 70 17 00 |);...T..|.D..@p..|
|00005cf0| 7d c2 bb ff 8d e9 bb ff | 70 1a 00 00 7d 0d 08 20 |}.......|p...}.. |
|00005d00| 0c 49 79 00 12 47 79 00 | 00 00 00 00 08 74 6f 20 |.Iy..Gy.|.....to |
|00005d10| 12 00 00 00 00 00 00 00 | 07 20 20 20 18 4a 79 00 |........|. .Jy.|
|00005d20| 18 4a 79 00 00 00 00 00 | 00 44 00 00 a5 48 00 00 |.Jy.....|.D...H..|
|00005d30| 40 00 00 00 ed ad bb ff | ad ba bb ff 00 00 00 00 |@.......|........|
|00005d40| 0d 08 20 20 18 4b 79 00 | 00 00 00 00 07 20 3d 20 |.. .Ky.|..... = |
|00005d50| 12 4c 79 00 12 4c 79 00 | 00 00 00 00 07 2d 3e 7b |.Ly..Ly.|.....->{|
|00005d60| 0c 4d 79 00 12 4c 79 00 | 0c 4d 79 00 00 00 00 00 |.My..Ly.|.My.....|
|00005d70| 00 48 00 00 25 30 00 00 | 40 c0 d4 01 ed 5c bb ff |.H..%0..|@....\..|
|00005d80| fd 83 bb ff 70 1a 00 00 | 73 75 62 20 68 61 70 70 |....p...|sub happ|
|00005d90| 79 5f 62 69 72 74 68 64 | 61 79 20 7b 0d 00 00 00 |y_birthd|ay {....|
|00005da0| 00 30 00 00 25 30 00 00 | 40 30 ec 01 0d 2e bb ff |.0..%0..|@0......|
|00005db0| 1d 55 bb ff 70 1a 00 00 | 20 20 20 20 6d 79 20 24 |.U..p...| my $|
|00005dc0| 73 65 6c 66 20 3d 20 73 | 68 69 66 74 3b 0d 00 00 |self = s|hift;...|
|00005dd0| 00 30 00 00 25 44 00 00 | 40 60 d8 03 2d ff ba ff |.0..%D..|@`..-...|
|00005de0| 3d 26 bb ff 70 1a 00 00 | 20 20 20 20 72 65 74 75 |=&..p...| retu|
|00005df0| 72 6e 20 24 73 65 6c 66 | 2d 3e 61 67 65 28 20 24 |rn $self|->age( $|
|00005e00| 73 65 6c 66 2d 3e 61 67 | 65 28 29 20 2b 20 31 20 |self->ag|e() + 1 |
|00005e10| 29 3b 0d 00 00 44 00 00 | a5 44 00 00 40 70 17 00 |);...D..|.D..@p..|
|00005e20| 4d d0 ba ff 5d f7 ba ff | 70 1a 00 00 7d 0d 08 72 |M...]...|p...}..r|
|00005e30| 0c 4e 79 00 12 4c 79 00 | 00 00 00 00 08 65 20 6d |.Ny..Ly.|.....e m|
|00005e40| 12 00 00 00 00 00 00 00 | 07 69 6e 67 18 4f 79 00 |........|.ing.Oy.|
|00005e50| 18 4f 79 00 00 00 00 00 | 00 44 00 00 a5 24 00 00 |.Oy.....|.D...$..|
|00005e60| 40 00 00 00 bd bb ba ff | 7d c8 ba ff 00 00 00 00 |@.......|}.......|
|00005e70| 0d 08 65 20 18 50 79 00 | 00 00 00 00 00 24 00 00 |..e .Py.|.....$..|
|00005e80| 05 8c 00 00 00 c0 c8 07 | ed 62 ba ff cd 91 ba ff |........|.b......|
|00005e90| 20 22 00 00 42 75 74 20 | 73 69 6e 63 65 20 74 68 | "..But |since th|
|00005ea0| 65 73 65 20 6d 65 74 68 | 6f 64 73 20 61 72 65 20 |ese meth|ods are |
|00005eb0| 61 6c 6c 20 65 78 65 63 | 75 74 69 6e 67 20 69 6e |all exec|uting in|
|00005ec0| 20 74 68 65 20 63 6c 61 | 73 73 20 69 74 73 65 6c | the cla|ss itsel|
|00005ed0| 66 2c 20 74 68 69 73 20 | 6d 61 79 20 6e 6f 74 20 |f, this |may not |
|00005ee0| 62 65 20 63 72 69 74 69 | 63 61 6c 2e 20 20 54 68 |be criti|cal. Th|
|00005ef0| 65 72 65 20 61 72 65 20 | 74 72 61 64 65 6f 66 66 |ere are |tradeoff|
|00005f00| 73 20 74 6f 20 00 00 00 | 00 8c 00 00 05 84 00 00 |s to ...|........|
|00005f10| 00 88 70 07 c6 2a ba ff | a6 59 ba ff 20 22 00 00 |..p..*..|.Y.. "..|
|00005f20| 62 65 20 6d 61 64 65 2e | 20 20 55 73 69 6e 67 20 |be made.| Using |
|00005f30| 64 69 72 65 63 74 20 68 | 61 73 68 20 61 63 63 65 |direct h|ash acce|
|00005f40| 73 73 20 69 73 20 66 61 | 73 74 65 72 20 28 61 62 |ss is fa|ster (ab|
|00005f50| 6f 75 74 20 61 6e 20 6f | 72 64 65 72 20 6f 66 20 |out an o|rder of |
|00005f60| 6d 61 67 6e 69 74 75 64 | 65 20 66 61 73 74 65 72 |magnitud|e faster|
|00005f70| 2c 20 69 6e 20 66 61 63 | 74 29 2c 20 61 6e 64 20 |, in fac|t), and |
|00005f80| 69 74 27 73 20 6d 6f 72 | 65 20 00 00 00 84 00 00 |it's mor|e ......|
|00005f90| 05 84 00 00 00 e4 ad 07 | 9f f2 b9 ff 7f 21 ba ff |........|.....!..|
|00005fa0| 20 22 00 00 63 6f 6e 76 | 65 6e 69 65 6e 74 20 77 | "..conv|enient w|
|00005fb0| 68 65 6e 20 79 6f 75 20 | 77 61 6e 74 20 74 6f 20 |hen you |want to |
|00005fc0| 69 6e 74 65 72 70 6f 6c | 61 74 65 20 69 6e 20 73 |interpol|ate in s|
|00005fd0| 74 72 69 6e 67 73 2e 20 | 20 42 75 74 20 75 73 69 |trings. | But usi|
|00005fe0| 6e 67 20 6d 65 74 68 6f | 64 73 20 28 74 68 65 20 |ng metho|ds (the |
|00005ff0| 65 78 74 65 72 6e 61 6c | 20 69 6e 74 65 72 66 61 |external| interfa|
|00006000| 63 65 29 20 69 6e 74 65 | 72 6e 61 6c 6c 79 20 00 |ce) inte|rnally .|
|00006010| 00 84 00 00 a5 90 00 00 | 40 f8 7e 07 78 ba b9 ff |........|@.~.x...|
|00006020| 58 e9 b9 ff 20 22 00 00 | 73 68 69 65 6c 64 73 20 |X... "..|shields |
|00006030| 6e 6f 74 20 6a 75 73 74 | 20 74 68 65 20 75 73 65 |not just| the use|
|00006040| 72 73 20 6f 66 20 79 6f | 75 72 20 63 6c 61 73 73 |rs of yo|ur class|
|00006050| 20 62 75 74 20 65 76 65 | 6e 20 79 6f 75 20 79 6f | but eve|n you yo|
|00006060| 75 72 73 65 6c 66 20 66 | 72 6f 6d 20 63 68 61 6e |urself f|rom chan|
|00006070| 67 65 73 20 69 6e 20 79 | 6f 75 72 20 64 61 74 61 |ges in y|our data|
|00006080| 20 72 65 70 72 65 73 65 | 6e 74 61 74 69 6f 6e 2e | represe|ntation.|
|00006090| 0d 07 74 20 08 51 79 00 | 08 51 79 00 00 00 00 00 |..t .Qy.|.Qy.....|
|000060a0| 00 90 00 00 a5 2c 00 00 | 40 d4 57 01 31 34 b9 ff |.....,..|@.W.14..|
|000060b0| 81 7a b9 ff 68 37 00 00 | 43 6c 61 73 73 20 44 61 |.z..h7..|Class Da|
|000060c0| 74 61 0d 08 08 52 79 00 | 00 00 00 00 00 2c 00 00 |ta...Ry.|.....,..|
|000060d0| 05 84 00 00 00 74 f0 07 | d0 db b8 ff b0 0a b9 ff |.....t..|........|
|000060e0| 20 22 00 00 57 68 61 74 | 20 61 62 6f 75 74 20 22 | "..What| about "|
|000060f0| 63 6c 61 73 73 20 64 61 | 74 61 22 2c 20 64 61 74 |class da|ta", dat|
|00006100| 61 20 69 74 65 6d 73 20 | 63 6f 6d 6d 6f 6e 20 74 |a items |common t|
|00006110| 6f 20 65 61 63 68 20 6f | 62 6a 65 63 74 20 69 6e |o each o|bject in|
|00006120| 20 61 20 63 6c 61 73 73 | 3f 20 57 68 61 74 20 77 | a class|? What w|
|00006130| 6f 75 6c 64 20 79 6f 75 | 20 77 61 6e 74 20 74 68 |ould you| want th|
|00006140| 61 74 20 66 6f 72 3f 20 | 20 57 65 6c 6c 2c 20 00 |at for? | Well, .|
|00006150| 00 84 00 00 25 84 00 00 | 40 5c ab 07 a9 a3 b8 ff |....%...|@\......|
|00006160| 89 d2 b8 ff 20 22 00 00 | 69 6e 20 79 6f 75 72 20 |.... "..|in your |
|00006170| 50 65 72 73 6f 6e 20 63 | 6c 61 73 73 2c 20 79 6f |Person c|lass, yo|
|00006180| 75 20 6d 69 67 68 74 20 | 6c 69 6b 65 20 74 6f 20 |u might |like to |
|00006190| 6b 65 65 70 20 74 72 61 | 63 6b 20 6f 66 20 74 68 |keep tra|ck of th|
|000061a0| 65 20 74 6f 74 61 6c 20 | 70 65 6f 70 6c 65 20 61 |e total |people a|
|000061b0| 6c 69 76 65 2e 20 20 48 | 6f 77 20 64 6f 20 79 6f |live. H|ow do yo|
|000061c0| 75 20 69 6d 70 6c 65 6d | 65 6e 74 20 74 68 61 74 |u implem|ent that|
|000061d0| 3f 0d 00 00 00 84 00 00 | 85 a0 00 00 00 44 d2 07 |?.......|.....D..|
|000061e0| d2 34 b8 ff b2 63 b8 ff | 20 22 00 00 59 6f 75 20 |.4...c..| "..You |
|000061f0| 07 69 73 20 11 53 79 00 | 11 53 79 00 00 00 00 00 |.is .Sy.|.Sy.....|
|00006200| 63 6f 75 6c 64 08 75 72 | 11 00 00 00 00 00 00 00 |could.ur|........|
|00006210| 20 6d 61 6b 65 20 69 74 | 20 61 20 67 6c 6f 62 61 | make it| a globa|
|00006220| 6c 20 76 61 72 69 61 62 | 6c 65 20 63 61 6c 6c 65 |l variab|le calle|
|00006230| 64 20 24 50 65 72 73 6f | 6e 3a 3a 43 65 6e 73 75 |d $Perso|n::Censu|
|00006240| 73 2e 20 20 42 75 74 20 | 61 62 6f 75 74 20 6f 6e |s. But |about on|
|00006250| 6c 79 20 72 65 61 73 6f | 6e 20 79 6f 75 27 64 20 |ly reaso|n you'd |
|00006260| 64 6f 20 74 68 61 74 20 | 77 6f 75 6c 64 20 62 65 |do that |would be|
|00006270| 20 00 00 00 00 a0 00 00 | 85 9c 00 00 00 34 cd 07 | .......|.....4..|
|00006280| ab fc b7 ff 8b 2b b8 ff | 20 22 00 00 69 66 20 79 |.....+..| "..if y|
|00006290| 6f 75 20 07 11 54 79 00 | 11 54 79 00 00 00 00 00 |ou ..Ty.|.Ty.....|
|000062a0| 77 61 6e 74 65 64 08 65 | 11 00 00 00 00 00 00 00 |wanted.e|........|
|000062b0| 20 70 65 6f 70 6c 65 20 | 74 6f 20 62 65 20 61 62 | people |to be ab|
|000062c0| 6c 65 20 74 6f 20 67 65 | 74 20 61 74 20 79 6f 75 |le to ge|t at you|
|000062d0| 72 20 63 6c 61 73 73 20 | 64 61 74 61 20 64 69 72 |r class |data dir|
|000062e0| 65 63 74 6c 79 2e 20 20 | 54 68 65 79 20 63 6f 75 |ectly. |They cou|
|000062f0| 6c 64 20 6a 75 73 74 20 | 73 61 79 20 24 50 65 72 |ld just |say $Per|
|00006300| 73 6f 6e 3a 3a 43 65 6e | 73 75 73 20 61 6e 64 20 |son::Cen|sus and |
|00006310| 00 9c 00 00 05 84 00 00 | 00 68 c9 07 84 c4 b7 ff |........|.h......|
|00006320| 64 f3 b7 ff 20 22 00 00 | 70 6c 61 79 20 61 72 6f |d... "..|play aro|
|00006330| 75 6e 64 20 77 69 74 68 | 20 69 74 2e 20 20 4d 61 |und with| it. Ma|
|00006340| 79 62 65 20 74 68 69 73 | 20 69 73 20 6f 6b 20 69 |ybe this| is ok i|
|00006350| 6e 20 79 6f 75 72 20 64 | 65 73 69 67 6e 20 73 63 |n your d|esign sc|
|00006360| 68 65 6d 65 2e 20 59 6f | 75 20 6d 69 67 68 74 20 |heme. Yo|u might |
|00006370| 65 76 65 6e 20 63 6f 6e | 63 65 69 76 61 62 6c 79 |even con|ceivably|
|00006380| 20 77 61 6e 74 20 74 6f | 20 6d 61 6b 65 20 69 74 | want to| make it|
|00006390| 20 00 00 00 00 84 00 00 | 05 84 00 00 00 ac 94 07 | .......|........|
|000063a0| 5d 8c b7 ff 3d bb b7 ff | 20 22 00 00 61 6e 20 65 |]...=...| "..an e|
|000063b0| 78 70 6f 72 74 65 64 20 | 76 61 72 69 61 62 6c 65 |xported |variable|
|000063c0| 2e 20 20 54 6f 20 62 65 | 20 65 78 70 6f 72 74 61 |. To be| exporta|
|000063d0| 62 6c 65 2c 20 61 20 76 | 61 72 69 61 62 6c 65 20 |ble, a v|ariable |
|000063e0| 6d 75 73 74 20 62 65 20 | 61 20 28 70 61 63 6b 61 |must be |a (packa|
|000063f0| 67 65 29 20 67 6c 6f 62 | 61 6c 2e 20 20 49 66 20 |ge) glob|al. If |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.