($copyto, $fail) = dbme ($newcopy, 1); $copyto->{$k} = $copyfrom->{$k}; # #... succeeds ... # #cleanup if (tied $copyto) { untie (%$copyto); print "CLEANUP: Tied-HASH now untied\n"; } else { print "'tied()'-test on copyto FAILED\n"; if (ref($copyto) eq 'HASH') {print "copyto= $copyto\n";} eval {untie (%$copyto);}; if ($@) {print "UNTIE copyto FAILED --> $@\n";} else { print "UNTIE copyto succeeded ......\n"; } } # # OUTPUT: # .. 'tied()'-test on copyto FAILED ...... # .. copyto= HASH-REF --> HASH(0x8e02f5c) # HANGS on "eval {untie (%$copyto);};" line # NEVER RETURNS ? #
EXPLANATION:
dbme() line-1 is in another module, gets a reference to a tied-hash handle on a Berkeley DB file from yet another module, returns it to this code, and which then succeeds. The record copied line-2 appears in the underlying file. But the 'untie' needed to then close the file hangs .. I have to CTRL-C to quit?
Can anyone see what I am getting wrong?
In reply to untie tied hash fails mysteriously by Pstack
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |