in reply to Re: Copying a hash to another hash problem
in thread Copying a hash to another hash problem

I probably should have given more info to what I was attempting here.
Basically, I have 700+ disks in a NAS environment, contained in 47 drawers within 7 frames. I want to monitor the temp of the drawers, so my array would contain (1-7) for the frames and (1-8) for the no of drawers within the frames (as they don't all contain the same no. of drawers).
Giving as an example, (1,1) would be frame 1, drawer 1 would point to the value 30, or (5,8) would be frame 5, drawer 8 giving a value of 25.

The reason I was copying the array, was that the next time the prog queried the temp, I could compare the arrays and notify me of any changes in the temp from the last run.

Cheers

Sean

  • Comment on Re: Re: Copying a hash to another hash problem

Replies are listed 'Best First'.
Re^3: Copying a hash to another hash problem
by Anonymous Monk on Nov 22, 2019 at 07:12 UTC
    I realise it is 17 years later now, but for what it is worth now in 2019, you don't have to use a copy for this, only return a new reference / object in the acquisition function that queriers the data of your hard disks. So, don't use global hashes/arrays with this function. Then, two successive calls of the acquisition function will already return two separate instances of your data and so there is no need to copy this any further.