in reply to Inheritance in the same file
B is an already existing package.
require will try to load a file from disk and fail if that file does not exist.
The combination means that some package "B" gets loaded from disk, so your require B never fails.
Your real problem is one of initializsation. @B::ISA gets initialized after your main program has run, so the inheritance chain is never set up.
I recommend reordering your source file to have the main program at the bottom, or better, move the packages out into separate files.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Inheritance in the same file
by stephen (Priest) on Jun 11, 2013 at 17:19 UTC | |
by yoda54 (Monk) on Jun 12, 2013 at 08:04 UTC | |
|
Re^2: Inheritance in the same file
by yoda54 (Monk) on Jun 11, 2013 at 07:58 UTC |