[pm-h] Binding variables to a reference

Todd Rinaldo toddr at null.net
Mon Dec 22 22:22:59 PST 2008


On Sun, Dec 21, 2008 at 3:47 PM, Robert Boone <robo4288 at gmail.com> wrote:
> But in my understanding of perl threads and the forks module is that
> you don't pass shared variables as arguments. You just declare them
> before creating the thread and use them because they're in scope.

Yeah, that's how I understand it too. I just feel a little dirty, like
I'm going end up in global variable hell. My other concern is I'd have
to do something silly like maintain hashes of variables indexed by
process ID so the copious threads don't step on each other. It just
seems like there has to be a better way. The only other sleeve I have
would require a lot of socket maintenance. I'm not sure what would be
worse.


More information about the Houston mailing list