http://www.perlmonks.org?node_id=1022963

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

Hi Monks, I've a little issue using $listbox->itemconfigure($listbox->size()-1, -foreground=>"#F00");
I want every entry which is a directory in red color.
sub readDir{ my @all = readdir(DIR); for my $x (sort (@all)){ next if($x =~ /^\.$/); $listbox->insert('end', $x); if(-d $x){ print "$x\n"; $listbox->itemconfigure($listbox->size()-1, -foreground=>" +#F00"); } } }
It works fine for the directory ".." but every other directory is ignored.
I'm looking forward for your help.

P.S. This is my first post ;-)

EDIT: my current OS is Debian with awesome-wm