in reply to ISA with packages ... A barebones minimal example
Question 1
B::... means look in package B specifically, not B and its base classes. Use B->... to do what you want:
print B->SayBye();
Keep in mind that sends an extra argument to SayBye, and SayBye's prototype is ignored if one is specified.
Question 2
You'll need to add a 1; at the end of each .pm file, but that's it.
Question 3
Your @ISA should probably be set at compile time:
BEGIN { our @ISA = ... }
Your Exporter code won't export anything until you move the packages to seperate files (because import never gets called). It's costumary to do Exporter stuff at compile time, yet it seems to work as is as well. (Update: It said the opposite earlier, until I realized inline code is probably executed before import is called. I tested it for confirmation.) You might want to get rid of Exporter completely if you're using Module->. Also, although not a bug, it's rarely nice to use @EXPORT instead of @EXPORT_OK.
|
|---|