Unfortunately I can't install Tk.pm in the office, so I am flying blind here. But the next thing I would try is moving that line into the main loop, instead of in the history subroutine.
One world, one people
Comment on Re^3: how to disable a menuitem at runtime