in reply to Re: Re: Re: Re: Re: use Module and case-insensitive file names
in thread use Module and case-insensitive file names

If you don't supply an import method for a package, it fails silently without warning. This goes for packages that... well... don't exist at all.

They're two separate issues. Given Foo->bar(), when Foo exists but Foo::bar doesn't, it goes though Autoload, ISA, etc. all the way up to UNIVERSAL. There is a &UNIVERSAL::import, though tye thinks it's a bug.

But what if Foo doesn't exist? Shouldn't that be a different kind of error? It surely would run into problems when it tried to use &Foo::AUTOLOAD, @Foo::ISA, etc., so I can only suppose that this is intentional behavior!

—John

  • Comment on Re: Re: Re: Re: Re: Re: use Module and case-insensitive file names

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Re: use Module and case-insensitive file names
by japhy (Canon) on Jul 31, 2001 at 02:06 UTC
    It's not illegal to see if a function exists in a certain package, and it's not illegal to see if an array exists, no matter how you qualify it. There's no bug there. Maybe having UNIVERSAL::import is a bug.

    _____________________________________________________
    Jeff japhy Pinyan: Perl, regex, and perl hacker.
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

      That's what tye points out in the snippet he pointed out on another thread: Exporter::import is aliased into UNIVERSAL::import, so its triggered even if you don't mention Exporter in your module. That just doesn't seem right.