As stand-alone code, this example produces the expected output. As a module (built with the h2xs boilerplate) make test fails with:
Tried to use 'TestOO'. # Error: Can't locate object method "new" via package "UI::Graphical" at /media/jroth/ecmd-dev/TestOO/blib/lib/TestOO.pm line 56.
Any ideas about this? I just pasted this stuff into the 'precompiled methods go here' indicator in the boilerplate.
Is there a reason why the children would inherit 'new' from the superclass in one context and not in another?
package UI; use Object::Tiny qw(dummy); sub hello {print "superclass hello\n"}; package UI::Graphical; @ISA = 'UI'; sub hello {print "make a window\n";} my $ui = UI->new; $ui->hello; $ui = UI::Graphical->new; $ui->hello; 1;
In reply to Re^2: Eliminating conditional code for GUI and text-mode operation
by gnosti
in thread Eliminating conditional code for GUI and text-mode operation
by gnosti
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |