What do you mean 'create a key/value' pair?

I am refering to the hash for the new item=>stockLevel for a supplier.

I would probably turn this into a hashref of hashrefs with the primary hashs keys being the supplier_id

I think that is a good idea too, thanks :)

Now that I've gotten thoroughly off-topic, what was your question again?

By no means! You have hit the nail on the head.

If you can provide more detail of what problem you're trying to solve...

Hmm :)
The object is an order. Each order has a set of suppliers that can supply at least one of the items in the order. Each supplier should have a complete list of how many of each of the items in the order they have in stock.

Statement: Using the data structure and sub in your reply (assuming the syntax is correct), calling &set_stock will effect a permament change in the object properties without the need for calling the &set function.

My question (pretty much) was "Is the above statement correct?"

--
Graq


In reply to Re: (Ovid) Re: Storing Info with Accessors by graq
in thread Storing Info with Accessors by graq

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.