It took me two hours to track down this error. I can work around it, but I don't understand it.
If I have a perl module ./lib/My/Foo.pm that looks like this:
package My::Foo;
sub import {print "importing\n"}
1;
Then using it calls the import subroutine implicitly:
$ PERL5LIB=./lib perl -MMy::Foo -e 'print "ok\n"'
importing
ok
But if I copy the same module and use it without the colons, the import subroutine is not called.
$ cp lib/My/Foo.pm lib/Foo.pm
$ PERL5LIB=./lib perl -MFoo -e 'print "ok\n"'
ok
If I change import to something else like do_import, the subroutine isn't called. So I can avoid this behavior. But in my real use case, I have an Import class and with an abstract method import, then implement that method in subclasses. So I don't want this import method called automatically when useing the parent class.
I looked in perlootut and perlobj and didn't see any mention of this.