http://www.perlmonks.org?node_id=299200


in reply to Re: Re: Re: use Very::Long::Module::Name as Foo;
in thread use Very::Long::Module::Name as Foo;

Wouldn't you have to transform Foo::Bar::Baz to Foo/Bar/Baz.pm, to make it work with require?

------
We are the carpenters and bricklayers of the Information Age.

The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

... strings and arrays will suffice. As they are easily available as native data types in any sane language, ... - blokhead, speaking on evolutionary algorithms

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

  • Comment on Re4: use Very::Long::Module::Name as Foo;

Replies are listed 'Best First'.
Re: Re4: use Very::Long::Module::Name as Foo;
by liz (Monsignor) on Oct 14, 2003 at 18:18 UTC
    No, because it is a source filter. It changes source such as:
    use Very::Long::Module::Name as Foo;
    to:
    BEGIN {*{"Foo::"} = \*{"Very::Long::Module::Name::"}}use Very::Long::M +odule::Name;
    essentially aliasing the stashes of the Foo namespace with the Very::Long::Module::Name namespace at compile time.

    So this is before anything is required under "use"s hood.

    Liz

Re: Re4: use Very::Long::Module::Name as Foo;
by tilly (Archbishop) on Oct 15, 2003 at 02:48 UTC
    Wouldn't you have to transform Foo::Bar::Baz to Foo/Bar/Baz.pm, to make it work with require?

    No. That was the point of the string eval.