home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!paladin.american.edu!darwin.sura.net!wupost!gumby!destroyer!ncar!csn!news.den.mmc.com!dino!snorman
- From: snorman@den.mmc.com ( Stephen P. Norman )
- Subject: Programming Perl: Pages 55-56?
- Message-ID: <1992Nov19.232606.18371@den.mmc.com>
- Keywords: perl, question
- Sender: news@den.mmc.com (News)
- Nntp-Posting-Host: dino.den.mmc.com
- Reply-To: snorman@den.mmc.com
- Organization: Martin Marietta Astronautics Group
- Distribution: usa
- Date: Thu, 19 Nov 1992 23:26:06 GMT
- Lines: 31
-
- I have just bought Programming Perl, First edition, March 1992 printing.
- On pages 55 to 56, (Chapter 1, Recursion) there is an example program on
- building and descending an associative array (Job and his decendants).
- I have carefully replicated this program on-line and it does not seem to
- work for me:
-
- 1) The routine 'do_a_begat': how does this routine dereference $parent{$name},
- which appears to be local to the routine 'load_kids'?
-
- 2) My version does not print out any results, as $parent{$name} is null
- in the routine 'do_a_begat'.
-
- So I tried the following:
-
- a) changed $parent{$name} in 'load_kids' to $tree{$name}
- b) changed $parent{$name} in 'do_a_begat' to $tree{$name}
-
- I now seem to get some results that make sense.
-
- 3) Am I missing something, or does this example really not work as written?
-
- 4) Are the example programs in this book on-line anywhere?
-
-
- Thanx for any tips - I am new to perl...
-
- Steve Norman
- Martin Marietta Astronautics Group
- PO Box 179
- Denver CO 80201
-
-