Are you sure that's the code you ran? It should work. And it works for me.
in reply to Re^2: Eliminating conditional code for GUI and text-mode operation
in thread Eliminating conditional code for GUI and text-mode operation
make a window
use Object::Tiny qw(dummy);
can be written as
but not as
use Object::Tiny qw( ); or
use Object::Tiny ( );
You would get the error you showed if you did one of the latter two.
Also, if you have no members, you can use
$ui = 'UI'; instead of $ui = UI->new();, and
$ui = 'UI::Graphical'; instead of $ui = UI::Graphical->new();.
However, you'll probably need some members, so you might as well continue the way you are going.