Skip to content

Commit

Permalink
use class_to_path to load modules in Mojo::Base
Browse files Browse the repository at this point in the history
  • Loading branch information
Grinnz committed Nov 7, 2017
1 parent 6b9a76c commit 4a8da70
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/Mojo/Base.pm
Expand Up @@ -76,9 +76,8 @@ sub import {
}

# Module
elsif ((my $file = $flags[0]) && !$flags[0]->can('new')) {
$file =~ s!::|'!/!g;
require "$file.pm";
elsif ($flags[0] && !$flags[0]->can('new')) {
require(Mojo::Util::class_to_path($flags[0]));
}

# "has" and possibly ISA
Expand Down

0 comments on commit 4a8da70

Please sign in to comment.