Importing the symbols into :: or main:: is exactly what I want (there is no package).

You can still do that in a more conventional and only slightly more complex way by writing a proper module and exporting only what you really need to. Polluting main:: is just a bad idea in any case.

Ideally what I want is #include "import.pl" but for reasons in the article above this isn't really there, unless you do some funky odd looking stuff with the DB module. I'd rather avoid funky odd looking stuff for this software as lots of people need to use and understand it. I do find it odd that an old C-coder like Larry W would choose not to give people the ability to #include.

Perl's convention to include stuff is to use modules. There are appearently simpler alternatives on which use itself is actually built, and there are situations in which one may actually want to resort to them. For example in golf you may want to do a file. But you're not golfing. When wanting to use a module to be decided at runtime based upon some condition, then you want to require and manually import(). But that's not your case either. And so on...

I've thought of writing modules and so forth here, but then I truly get into different lexical scopes, which I'm trying to avoid for simplicity sake. (Read simplicity=50% laziness , 50% easy for non-perlers to understand). Thanks, dch.

Don't be misleaded by a wrong concept of simplicity. Do not aim for maximum simplicity, since chances are that it will bite you in the neck later on, revealing itself to only be appearently simple. I am aware of YAGNI, but there's stuff it's easy to know in advance YareGN, and even if it weren't so in some particular situation, it would in most common ones, thus getting the habit of doing so would raise the risk of making that into a bad programming habit. Aim for the Right® amount simplicity.

Also, as Perl programmers we all know that Laziness is a cardinal virtue, but IMHO not really as of itself only.


In reply to Re^5: strict/do question by blazar
in thread strict/do question by dch

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.