"Octavian Rasnita" <orasn...@gmail.com> writes: > package WxTrial; > > use Moose; > use Wx; > > extends 'Wx::SimpleApp';
I assume this means that WxTrial is a derived class from Wx::SimpleApp. Wx::SimpleApp is derived (straightforward) from Wx::App. You do not supply a new method, so the new method that gets called (WxTrial->new) is Wx::App->new. This method allows one argument, a code ref, the routine to call instead of the default OnInit. > my $t = WxTrial->new(foo => "bar"); You supply two arguments, strings "foo" and "bar. Hence the error message: > sub must be a CODE reference at E:/usr/site/lib/Wx/App.pm line 36. Hope this explains what happens. -- Johan