Subject: | Non-file traits |
Currently, a trait must be in its own file. It would be nice if that
were not true, like "use base".
Although I cannot think of a use beyond testing and debugging as a trait
that isn't in its own file doesn't seem very reusable and defeats the
point of a trait.
#!/usr/bin/perl -w
package TTest;
use Class::Trait 'base';
sub name {
return "wibble";
}
package Foo;
use Class::Trait "TTest";
sub new { bless {} }
package main;
my $foo = Foo->new;
print $foo->name;