Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am doing some simple text conversion in Perl/Tk and then save data from a scrolled text using $mw->getSaveFile(). It all works fine. However, after closing the file handle, I still cannot access the file saved in its entirety while the Perl/Tk application is open. Is this by design? Is there a trick to get access to the file while the application is in the background/minimized? Thank you guys. Maimonedis

Replies are listed 'Best First'.
Re: Perl/Tk and locking
by renodino (Curate) on Nov 27, 2005 at 02:48 UTC
    1. Please let us know what platform/OS you're running this on
    2. Let us know what version of Perl you're running
    3. Let us know what version of Perl/Tk you're running
    4. A small code sample would be of value
    Without that info, its very difficult to diagnose your issue. It may be as simple as setting autoflush on your file handle:
    my $oldfd = select TKFD; $| = 1; select $oldfd;
      I am running ActiveState's Perl v5.8.7 built for MSWin32-x86-multi-thread on a Windows machine with Perl/Tk version 804.27.0.2. Adding the $| =1 autoflush to the code did the trick. Thanks a bunch for your help.