Exercises: Do these in order. Do all of them. I promise not to waste your time. 0. There should be directories named `Module' and `Class' next to this one. Do all the exercises there first. Then come back here. 1. Read the code in hello.pl and Message.pm and FancyMessage.pm. Run hello.pl and see what happens. Notice that even though both objects have the same message in them, different things happen when we call their `printme' methods. 2. Add a line to the `new' function in Message.pm that prints out the value of $package whenever `new' is called. How many times it called? What lines in hello.pl cause calls to `new'? 3. Do the same for the `setmessage' function. Have it print out the value of $self. How many times is it called? Do the same for the `printme' function in Message.pm. Have it print out the value of $self. How many times is it called? 4. Go into FancyMessage.pm and edit out the line that sets @ISA. Run hello.pl and see what happens. 5. Make a test program that creates some objects from the class VeryFancyMessage and calls some methods on them. What methods exist for thse objects? What methods are actually defined in VeryFancyMessage.pm? 6. If your test program didn't already invoke the `printme' method for some VeryFancyMessage object, add code that does this. Notice what is printed out. Which `printme' method is actually being called? 7. Add a `printme' method to VeryFancyMessage.pm that prints out the object's message with two rows of stars above it and below it. Rerun your sample program from exercise 6. Which `printme' method is being called now? 8. Write to me with a suggestion about the notes or exercises could be improved. mjd-perl-modtut@plover.com