I like the idea. I think it should be kept as minimal as possible, though - not 'Our::Code::O*' just 'Our::Code::*'.

I'm not sure about the import part. On the one hand, I want it to just be like a shortcut for a namespace, so not do an import; but on the other hand, that would be really messy to do the import at the last minute when you actually use a module from that namespace. I think you also have a problem of it not just being new that can be used, as some modules can use other names, and also there are package variables. I'm not sure how Java deals with package variables and namespaces.

And the last question about resolving DateTime versus Our::Code::DateTime, how does Java deal with that? Is it like putting the namespace at the beginning of @INC?


In reply to Re: A Perl Version of Java's import by ForgotPasswordAgain
in thread A Perl Version of Java's import 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.