in reply to Re: Threads, DBI, Shared Variables problem
in thread Threads, DBI, Shared Variables problem

Oops, sorry about the mismatched variable names, I was fiddling around to find a fix and thought the solution was to use a reference to "$row". These are only snippets so I understand the confusion. The ultimate goal of my script is to start with an existing hash containing hostnames, and then have threads to go ssh to each hostname, retrieve some information, and then add it to the hash. If this weren't threaded, it would have been simple, but it seems when you spin off a thread, it gets it's own local copy of variables and does not manipulate variables outside of it.
  • Comment on Re^2: Threads, DBI, Shared Variables problem

Replies are listed 'Best First'.
Re^3: Threads, DBI, Shared Variables problem
by xajin25 (Initiate) on May 26, 2013 at 16:37 UTC
    I've updated the code to make it more clear. Also, would your example work with threads?
      "I've updated the code to make it more clear."

      You've added, modified and deleted code from your original post (OP). This potentially renders responses to your OP either meaningless or, at best, confusing. An example of how to update a post is contained in my original response. Please read "How do I change/delete my post?".

      "Also, would your example work with threads?"

      Why wouldn't it? What did you try? What problems did you encounter? Please read "How do I post a question effectively?".

      -- Ken