I guess you never use strict, warnings, lib, CGI, or many other core modules since it would be hopelessly confusing for people to find that they weren't importing symbols into your package.

I don't know where this 'use is only for importing symbols' meme snuck in, but I've certainly never read that rule anywhere and don't assume only symbol exporting when I see a module. In fact, the meme is plain wrong.

It is certainly common for modules to primarily export symbols. It is also certainly common for subroutines to work on numbers. But there are plenty of modules that don't export symbols and it often makes sense to make it easy for the module user to pass arguments in.

In fact, I'm pretty sure that Larry and company provided the mechanism for that reason, especially since they immediately went out and used it (and not for importing symbols).

- tye        


In reply to Re^4: "use" modifier code via import() by tye
in thread "use" modifier code via import() by pbeckingham

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.