I have never heard of "Perl from the Ground UP" so I cannot tell you whether or not it is bad. But be warned that there are lots of bad books out there, and I have probably heard of most of the worthwhile ones...

Anyways using features when you don't understand what they are supposed to be doing is generally a bad idea. That leads to cargo-cult programming, a subject which leads to rants around here from time to time.

In particular the only way you are getting away with your prototypes is that Perl is completely and absolutely ignoring them. Which means that if you ever try to write regular procedural code you will be hopelessly confused. For a full explanation try this rant.

Beyond that, try putting:

use strict;
at the top of your module and seeing how much it complains. While you are at it do not write to globals in packages outside of yours without permission. (Yes, I am talking about $::Lady_TM.) It looks like you have not yet learned about pod. The (commented out) locking code makes a number of mistakes. Starting with trying to lock the filehandle before trying to open the file. That simply cannot work (though you don't test for the error so you wouldn't notice).

Also for hashing you might want to look at existing modules. In particular the widely-used DB_File.


In reply to Re (tilly) 3: Lady_TM by tilly
in thread Lady_TM by Steeeeeve

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.