in reply to Inheritance question

Move your calls to new to the end of the file.

Or, replace: @ISA = qw/A/ with: use base 'A'.

The problem is that @ISA = qw/A/ is not being run at compile time, and so package B isn't completely set up before you call B->new().