in reply to Re: eval doesn't work under tkx
in thread eval doesn't work under tkx

Hi and thanks for replying. I don't know what you mean by 'resetting $@' . . . also, I'm certain that the code never gets to the error handler. If I put 'print' statements around the 'execute' part of it, like
print "hi" $sth->execute(); print "bye"
I'll only get "hi" as output. If I put a print statement inside the error handler, it doesn't show. But if I invoke the function without the Tkx, it works fine. I swear, the only difference between it working and not working is the presence or absence of the Tkx loop, which is in another module - the code I've shown you earlier is identical in both cases.

Replies are listed 'Best First'.
Re^3: eval doesn't work under tkx
by shmem (Chancellor) on Jul 16, 2010 at 08:55 UTC

    I mean the following:

    while ($sqlSuccess == 0) { eval { ... }; if ($@) { my $errString = $@; $@ = ''; # <-- here print $fileHandle "caught error $errString\n"; ... } }
      Thanks for your reply - I've been parsing the sql statement and doing a 'drop table' in the meantime, but I'll try your suggestion. Thanks again