Skip to content

Commit

Permalink
deprecate use of old package separator ' in Mojo::Loader::load_class
Browse files Browse the repository at this point in the history
  • Loading branch information
Grinnz committed Aug 13, 2024
1 parent 0762e20 commit a4e7257
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Mojo/Loader.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use Mojo::Base -strict;
use Exporter qw(import);
use Mojo::Exception;
use Mojo::File qw(path);
use Mojo::Util qw(b64_decode class_to_path);
use Mojo::Util qw(b64_decode class_to_path deprecated);

our @EXPORT_OK = qw(data_section file_is_binary find_modules find_packages load_class load_classes);

Expand Down Expand Up @@ -42,6 +42,9 @@ sub load_class {

# Invalid class name
return 1 if ($class || '') !~ /^\w(?:[\w:']*\w)?$/;
deprecated
q{Calling Mojo::Loader::load_class with a class name using the old package separator "'" is deprecated; use "::"}
if $class =~ m/'/;

# Load if not already loaded
return undef if $class->can('new') || eval "require $class; 1";
Expand Down

0 comments on commit a4e7257

Please sign in to comment.