in reply to Re: maybe, a corrupt selected entry in Tk::BrowseEntry
in thread maybe, a corrupt selected entry in Tk::BrowseEntry

Please show us what $cpath actually contains, instead of describing it as "visually the same". See $Data::Dumper::Useqq for how to make Data::Dumper output invisible characters.
the value in a @folders array element:
/media/igor/chmk/home/zamutnii/BackUp/LanBackup/СЭД/FkClnt1/SUBSYS/PRINT/RTF/
the value in %file_system's key:
/media/igor/chmk/home/zamutnii/BackUp/LanBackup/СЭД/FkClnt1/SUBSYS/PRINT/RTF/
the value in $cpath:
/media/igor/chmk/home/zamutnii/BackUp/LanBackup/СЭД/FkClnt1/SUBSYS/PRINT/RTF/
the first two match, but the last one doesn't match with either.
I will check out Data Dumper
Also, consider trying to find out what triggers the "sometimes" situations. You might also want to record more information, like whether $file_system{ $cpath } exists instead of blindly grabbing its value.
I gave examples in my code that I was testing it for existence. A wish to solve what triggers, is exactly, the reason I posted the question, because, I've been trying to solve this problem for a one a half of the day already.
  • Comment on Re^2: maybe, a corrupt selected entry in Tk::BrowseEntry

Replies are listed 'Best First'.
Re^3: maybe, a corrupt selected entry in Tk::BrowseEntry
by Corion (Patriarch) on Dec 22, 2014 at 16:22 UTC

    Most likely, you have two strings that are similar in how they display but are different in how they are encoded. The easiest way to get two such strings is by reading one from a file and the other from the filesystem, for example via readdir.

    If you are certain that your file system stores filenames as UTF-8, you can Encode::decode the filenames. You should do likewise with the filenames read from your file or stored in your program code. That way, the filenames should be consistent.