Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
After talking with a coworker, I came up with a scheme that would allow me to do this:
#!/usr/bin/perl -w
use strict;
use Class::WhenNeeded 'Foo';
my $customer = Foo::Customer->new;
my $company = Foo::Company->new;
my $salesrep = Foo::Company::SalesRep->new;
In other words, you to skip long declarations of "using" all of the packages (in my scheme, this happens at runtime on an "as needed" basis).
So here I am, thinking this is such an interesting idea and frankly, I haven't seen anyone do anything this general purpose before with this type of syntax. So I post this to Perlmonks.
The same day, BrowserUK poses a virtually identical problem. What a weird frickin' coincidence. I feel like a bit stupid as it almost looks like I stole someone elsess idea (and hence this long post).
Weird coincidence (Score:2, Interesting)
->notation to do the same sort of thing:I just hand-code the
Barmethod, but then I don't need multi-level stuff likemy $qux = Foo->Bar->Baz->Qux->new, which would be relatively easy withAUTOLOAD.What's not a coincidence is the (not very obvious) similarity here to Self [sun.com] and its "paths to objects" idiom/dogma.
See also UNIVERSAL::moniker (Score:2)