Hi Dave. >> Anyway, my question is that $x is a lexical inside run_test, and as much >>as >> I understood it was not suppose to be copied to the new thread. But it >is.
>In a new thread, *everything* is copied, apart from the calling stacks. Well, It seen that the calling stack is copied too. But it kept frozen until the thread is destroyed, and then Perl destroy the calling stack frame by frame. On one hand, it does not make sense. Why should we copy variables (lexical) that we can't access? On the other hand, it is obvious. If we copy everything, then functions like CLONE that are called package-wise, won't have to difference between lexical created objects and global accessible objects. It's probably impossible too. Thanks for getting things straight, Shmuel.