How to restart all hashes and arrays halfway through script

K

Ken Soon

Hi,
I am using dynamic arrays and hashes to store data. The names of the hashes
and arrays changes to a certain groups of names and there are alot of names.

Then i did some operations on this data with file::find, write to some files
and others....
However, as i continue on to another new operation on those hashes and
arrays, somehow all the values are gone or different (I'm not sure yet
whether is gone or different as I'm having trouble debugging to find out the
confirmed erroneous output)
Thus I am hoping if there such a thing to reset everything before i start on
that next operation. (as if i am restarting the script at that point)

Hmm all this sound abit weird though but i guess it is because haven't been
able to debug the problem.

hope my point is clear :X
 
B

Brian McCauley

I am using dynamic arrays and hashes to store data. The names of the hashes
and arrays changes to a certain groups of names and there are alot of names.

It sounds to me like you are saying you are using symbolic references.

This is probably the cause of you problem. Stop doing it and your
problems will probably go away.
Then i did some operations on this data with file::find, write to some files
and others....
However, as i continue on to another new operation on those hashes and
arrays, somehow all the values are gone or different (I'm not sure yet
whether is gone or different as I'm having trouble debugging to find out the
confirmed erroneous output)
Thus I am hoping if there such a thing to reset everything before i start on
that next operation. (as if i am restarting the script at that point)

Hey, a SAQ! But you really do _not_ want the reset() function. Declare
all your variables as lexically in the smallest applicable scope and
you'll probably find your problem goes away.
Hmm all this sound abit weird though but i guess it is because haven't been
able to debug the problem.

Lots of global variables and symbolic references will do that.
hope my point is clear :X

Your point would be much clearer if you'd made it by showing us a
_minimal_ but _complete_ (strict, warning-free) script that you'd run
and found to reproduce the problem you are having.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top