jeanluca has asked for the wisdom of the Perl Monks concerning the following question:
This is how I try to use itpackage Xyz ; use strict ; use warnings ; use Class::Trait 'base' ; package Xyz::XML ; use base qw(Xyz) ; sub render { print "test render XML" ; } package Xyz::YAML ; ...... etc
Running this code gives:use Xyz ; Xyz::XML->render() ; # this works Class::Trait->apply($my_obj, 'Xyz::XML') ; # problems
It cannot find this file because the package Xyz::XML is inside Xyz.pm.test render XML Trait (Xyz::XML) could not be found : Can't locate Xyz/XML.pm ......
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Class::Traits not happy with multiple packages per file
by ikegami (Patriarch) on Jun 27, 2007 at 14:08 UTC | |
|
Re: Class::Traits not happy with multiple packages per file
by stvn (Monsignor) on Jun 27, 2007 at 17:23 UTC |