in reply to Problem localizing $_ using threads::shared
I get the same results with either sub, but you don't show the code where you are calling doit_my().
Is it possible that you made a mistake? In the code where you call the local version you have:
$$x{foo} = join " ", map '"'.doit_local($_).'"', .....
Ie. You are passing $_ into doit_local(), but nowhere in your code is $_ ever assigned a value?
Inside the sub, you then local $_ and assign $_ to it, but you have still never assigned any value, so it is undef, whihch explains the 'uninitialized value' errors.
If I call doit_my($_), I get exactly the same results and errors. What did you pass to doit_my()?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem localizing $_ using threads::shared
by duelafn (Parson) on Nov 13, 2005 at 13:08 UTC |