in reply to Re: Re: use Very::Long::Module::Name as Foo;
in thread use Very::Long::Module::Name as Foo;
Method calls are cached so it makes no difference what package they are called against.Ah yes, I'm forever forgetting that!
And the constant-or-variable-with-package-name-in-it approach has the same properties as your code FWICT.But it's not an alias, it's just a shorter way of referring to a package name (although this does equate to the same thing when calling class methods). It means the difference between referring symbolically to the original package, and referring to the package directly via the alias e.g
Ok, so it might be a somewhat contrived, but I think it nicely illustrates that the two approaches are not the same.## accessing a package variable my $path = ${"$var\::Config"}->{'data_path'}; ## vs. my $path = $alias::Config->{'data_path'};
_________
broquaint
|
|---|