perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

Fatalization of calling import/unimport method with argument

Open jkeenan opened this issue 3 months ago • 4 comments

Per perldoc perldeprecation, we have three deprecations (actually, fatalizations) scheduled for perl-5.44 (May 2026 release). This is one of them.

=head3 Calling a missing C<import()> or C<unimport()> method with an argument

Historically calling C<import()> or C<unimport()> on any class which did
not define such a method would be silently ignored. Effectively Perl
behaved as though there was an empty method defined in the C<UNIVERSAL>
package (even when there was no such method actually defined). As of
Perl version 5.39.2 calling such a method I<with> an argument will
trigger a warning, and in Perl version 5.44 this warning will be 
upgraded to an error. (Calling such a method with no arguments at all
will always be safe.)

Category: "deprecated::missing_import_called_with_args"

This was scheduled in f1cf82e77b0 in July 2023. AFAICT we don't yet have anyone working on this, nor have we received a pull request.

Assuming we're going forward with this ... volunteers? @Leont, @ap, @leonerd (PSC) any thoughts?

jkeenan avatar Aug 22 '25 11:08 jkeenan