Karl Williamson wrote: >Within its scope Perl attempts to decode $! as best it can, Scoping doesn't work well for this sort of thing. The decoding happens in get magic, when the variable is being read. If that behaviour is affected by the lexical scope in which the reading happens, this means that different readers will see different values in the same variable, which is awfully confusing if a reference to the variable gets passed around. Worse, XS code gets the behaviour of *its caller's* lexical scope. Amusingly, $[ used to influence $#foo magic variables in this manner. It's one of the reasons I'm glad we got rid of $[. -zeframThread Previous | Thread Next