What do you mean by package? There are scripts, modules and distributions. You used require, so it better be a module. If it's not a module, it doesn't make sense to use require or use. It's a bug.

Why did you revert the extension change? It confuses your readers and maintainers. It also forces you to use require instead of use. Not only is that really unusual, it serves no benefit and it causes a number of issues.

Why did you remove the file name from the message? It would have solved your original problem if the error message had included the file name. It helps elsewhere too.

Why did you add the line number to the IO message (by removing the "\n"). If your program can't open the file because it wasn't found or because of a permission problem or for any other reason, the person reading the message has no need to know the error occurred at line 11 of your module to fix the problem.

Why did you move use strict; and use warnings; into the sub, effectively turning them off for the rest of the module.

Why did you move the output back into the reader? That makes no sense.


In reply to Re^3: Perl Packages Issue in a script. by ikegami
in thread Perl Packages Issue in a script. by Irishboy24

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.