Grygonos has asked for the wisdom of the Perl Monks concerning the following question:
I have the following bit of code
This code is for handling double clicks on a Tk-Listbox. Which should attempt to open a file/dir, and then when it is open check to see if it is a directory. If the selected listbox item is a directory it should call fillQueryBox(), if its not it should simply insert the item selected into another Tk-Listboxopen TEST,$path."\\".$item && do{-d TEST ? fillQueryBox($path."\\".$item,$qBox) : $cBox->insert('end +',$item); close TEST; last CLICK_OPTION;};
the error I am getting is -d on closed filehandle TEST at C:/Perl/lib/list_maker.pl line l47 It was my understanding that a file open returned true on success... so it would pass the && and fall into the do{} block, implying the file or directory was open for me to call a -d <HANDLE> on.
WHAT AM I MISSING?...pardon the frustration.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File closing on its own?
by Abigail-II (Bishop) on Nov 24, 2003 at 22:21 UTC | |
|
Re: File closing on its own?
by idsfa (Vicar) on Nov 24, 2003 at 22:24 UTC | |
by Grygonos (Chaplain) on Nov 25, 2003 at 14:26 UTC |