... is there a better way to do this too?
Not really, UNIVERSAL::require is nice, but it pollutes UNIVERSAL, which is bad. Inside Moose we actually do this:
whenever we need to load a class. But aside from that I don't have a better suggestion.my $file = $class . '.pm'; $file =~ s{::}{/}g; eval { CORE::require($file) }; confess("Could not load module '$class' because : $@") if $@;
In reply to Re^3: Calling chains, extends, and subclassing
by stvn
in thread Calling chains, extends, and subclassing
by EvanCarroll
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |