On Wed, 19 Nov 2003, Chris Nandor wrote:

> However, the code above is broken anyway, as Dan might point out, since
> $error_handler COULD contain syscalls, so I am modifying this particular
> code to set $^E right before the return, and use a lexical var for the
> other stuff.  That fixes the immediate problem, and it is more robust in
> case $error_handler does contain a syscall.

I was insufficiently pedantic -- it's not just system calls that can
change errno (just checked). Any C library function can do so. Including,
unfortunately, malloc. Luckily there's right-to-left ordering of
evaluation (more or less) so "$foo = $!;" will be OK. Anything fancier,
though, that could involve a function call (including plain
stringification) may not be. Bring on the Heisenbugs!

I think I'll take steps to make this less likely for Parrot, though I'm
not sure there's truly any good way to get around it anywhere but in the
actual application code.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to