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

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

  • Comment on Re: (Ovid) Re: Storing Info with Accessors