but I thought I have already declared @state? I declared it as a shared variable... if I declare it again in the subs, I won't be using the same shared variable "state" anymore, right?
I'm a little bit confused... I know if I comment out "strict" it will work... but where else do you suggest I declare state?
Thank you very much
| [reply] |
No you did not declare @state. You declared $state which is an entirely different variable. Most probably make_shared_array() returns an array reference to you. Check the documentation.And BTW, dont call it as &make_shared_array(): that is very "old" style and it has side-effects you probably do not know about. Deleting use strict is not a good idea. It pointed an error out to you. Removing use strict does not make the error go away, only the error message, the error being that @state is not the shared variable you think it is, a very fundamental error. Update: A rather handy trick you can try is using Data::Dumper to inspect your arrays and hashes. Then you do not have to write all these for loops with nothing but a print inside.
CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James My blog: Imperial Deltronics
| [reply] [d/l] [select] |
| [reply] [d/l] |