Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Bug in latest File::Util?by martell (Hermit) |
on Jun 21, 2016 at 10:07 UTC ( [id://1166176]=perlquestion: print w/replies, xml ) | Need Help?? |
martell has asked for the wisdom of the Perl Monks concerning the following question: Dear Monks, I think I found a bug in the File::Util (File-Util-4.161200) package. $f->list_dir() doesn't work when no files are present in the directory. Can someone have a look if they see this too and this isn't an error on my part?
Case: Step 1: Locate on your system a directory that contains no files, but can contain subdirectories. Example "/home/my_user/foo", containing "/home/my_user/foo/bar" and /home/my_user/foo/bar2". Step 2: Try to list the directories with: perl -e 'use strict; use File::Util;my $f = File::Util->new(); my @d = $f->list_dir("/home/my_user/foo/"); print join " ", @d, "\n";'This results in following error: Can't use an undefined value as an ARRAY reference at /usr/local/share/perl/5.14.2/File/Util.pm line 452.Step 3: Create an file in "/home/my_user/foo/". Example "test.txt" Step 4: Run the same perl snippet again. This results in the correct expected result: . .. bar bar2 test.txtModule: File-Util-4.161200 I would appreciate that someone can confirm this before I report this as a bug to the maintainer of the package. I tried the same code on a different system with File-Util-4.132140 and there it worked as expected Kind regards Martell Update: All, thanks for the quick reactions and the verifying. I posted this as a bug report on cpan: Update: I can confirm that the bug is resolved in version 4.161950. Thanks Tommy for your work.
Back to
Seekers of Perl Wisdom
|
|