When I wrote that it was only half a joke. In Ovid's pseudo-perl examples above, he was just using

use WhenNeeded 'Foo';

but showed the Java syntax import foo.*; as an example of his inspiration.

It struck me that as part of his pseudo-code involved using Find::File, that there might be some merit in using perl's globing behaviour to extend the Javan syntax and select subsets of a namespace. I then tried to look for a good example where using it would allow the selection of a realistic subset of an existing namespace, but couldn't find anything where more than foo::* (or I guess on non-dosish systems that would more properly be Foo::.*) would likely be used.

At that point I realised that if the only common usage would be to select everything below a given point in the hierachy, then the * or .* becomes redundant and Ovid's original syntax would probably make more sense.

I guess if the module was available, it might encourage authors to break up some of their bigger modules into smaller chunks spread across a deeper hierachy than is the norm? Which might lighten the load of some of them.

I could perhaps see use CGI; being broken up so that you could do

use WhenNeeded 'CGI::HTML3::Table*', 'CGI::Netscape::*' ;

And maybe

use WhenNeeded 'Date::Manip::EN::*';

So, no. I don't think that any resemblance to Javan syntax is really a problem, I just can't see a need for it currently, but that may mean I am limiting my imagination.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
If I understand your problem, I can solve it! Of course, the same can be said for you.


In reply to Re: Re: Re: Re: Re: DWIM: autoloading classes by BrowserUk
in thread DWIM: autoloading classes by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.