in reply to Re^15: Help needed with regard to arrays
in thread Help needed with regard to arrays

OK , I checked out @lines. It appears that the code is "working as written". The "storeplaceholder" gets overwritten by the value of $item but then that $line is assigned to the next thread. The regular expression obviously fails since there is no "storeplaceholder" to replace. Is there a better way to do this? I have tried share(@lines) and lock() with no luck....but I dont think that is the issue here...
  • Comment on Re^16: Help needed with regard to arrays

Replies are listed 'Best First'.
Re^17: Help needed with regard to arrays
by Corion (Patriarch) on Dec 01, 2008 at 20:59 UTC

    Yes, you found the problem. A simple approach could be to use a copy of @lines to modify and then execute. That way you would still have the original @lines around for the next round.

    Why do you think that share() or lock() come into play? Is the problem related to threads? Did you check that? You can easily switch your program into single-threaded mode. Does the error persist?

    Note that these are all rhetorical questions for me - they are intended to guide you in the process of debugging and eliminating all other possible causes.