But Fields had a "use mem".

mem tells perl to use the in-memory copy of Fields (via adding it to the appropriate perlvar).

I put a "use mem" inside any of my modules that need to be used in the same file. I also add a '1' at the end of the module, so if I later cut/paste the module out to a separate file, it shouldn't require modification.

I also, often, use mem to insert "1-liner" BEGIN-needing assignments, as it looks a bit cleaner (IMOpinion), than equivalent the equivalent 1-liner using BEGIN{}. For multiple lines or, especially, when needing code, I tend more toward using an actual BEGIN block these days.

I could use any module that ignores it's parameters for the same purpose, but mem guarantees it won't pay attention to their content, so its short and convenient. Ikegami used an equivalent assignment to some perlvar to do the same, but I often forget the var (or confuse it with INCLUDE), thus find mem easier to remember. :-| (*str8 face*)


In reply to Re^5: Why is @flds not imported? (%INC) by perl-diddler
in thread Why is @flds not imported? by perl-diddler

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.