Subject: | Error when calling File::Util::list_dir |
Date: | Tue, 16 Jul 2013 10:15:05 +0000 |
To: | "bug-File-Util [...] rt.cpan.org" <bug-File-Util [...] rt.cpan.org> |
From: | Fiona Corden <Fiona.Corden [...] metaswitch.com> |
I see the following error when calling File::Util::list_dir from the script below. This script works with version 3.39 of File::Util but fails with version 4.131591. To test, you need subdirectories code and/or internal below the script location. I have further subdirectories in both of code and internal, I don't know if this is crucial to the repro (and I'm not going to delete my codebase to find out!).
Can't use an undefined value as an ARRAY reference at /usr/local/share/perl/5.14.2/File/Util.pm line 454.
Repro script
#!/usr/bin/perl -w
use FindBin;
use File::Util;
my $cROOTDIR = $FindBin::Bin;
my $cCODEDIR = "$cROOTDIR/code";
my $cINTERNALDIR = "$cROOTDIR/internal";
my $gFileUtil = File::Util->new();
foreach my $lDir ($cCODEDIR, $cINTERNALDIR)
{
#*************************************************************************#
#* We can't search for directories under X, if X isn't present - so *#
#* check first. *#
#*************************************************************************#
if (-d $lDir)
{
#***********************************************************************#
#* Search for directories. *#
#***********************************************************************#
my @lDirs = $gFileUtil->list_dir($lDir, qw(--dirs-only --no-fsdots));
}
}
System info
uname -a
Linux fiona-VirtualBox 3.2.0-44-generic-pae #69-Ubuntu SMP Thu May 16 18:50:07 UTC 2013 i686 i686 i386 GNU/Linux
perl -v
This is perl 5, version 14, subversion 2 (v5.14.2) built for i686-linux-gnu-thread-multi-64int
(with 56 registered patches, see perl -V for more detail)
cpan[1]> upgrade File::Util
Going to read '/home/fiona/.cpan/Metadata'
Database was generated on Tue, 16 Jul 2013 04:53:05 GMT
Fetching with HTTP::Tiny:
http://mirror.tje.me.uk/pub/mirrors/ftp.cpan.org/authors/01mailrc.txt.gz
Going to read '/home/fiona/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Fetching with HTTP::Tiny:
http://mirror.tje.me.uk/pub/mirrors/ftp.cpan.org/modules/02packages.details.txt.gz
Going to read '/home/fiona/.cpan/sources/modules/02packages.details.txt.gz'
Database was generated on Tue, 16 Jul 2013 04:53:05 GMT
HTTP::Date not available
..............
New CPAN.pm version (v2.00) available.
[Currently running version is v1.960001]
You might want to try
install CPAN
reload cpan
to both upgrade CPAN.pm and run the new version without leaving
the current session.
..............................................................DONE
Fetching with HTTP::Tiny:
http://mirror.tje.me.uk/pub/mirrors/ftp.cpan.org/modules/03modlist.data.gz
Going to read '/home/fiona/.cpan/sources/modules/03modlist.data.gz'
............................................................................DONE
Going to write /home/fiona/.cpan/Metadata
Package namespace installed latest in CPAN file
File::Util 3.39 4.131591 TOMMY/File-Util-4.131591.tar.gz
Running install for module 'File::Util'
Running make for T/TO/TOMMY/File-Util-4.131591.tar.gz
Checksum for /home/fiona/.cpan/sources/authors/id/T/TO/TOMMY/File-Util-4.131591.tar.gz ok
Scanning cache /home/fiona/.cpan/build for sizes
............................................................................DONE
CPAN.pm: Going to build T/TO/TOMMY/File-Util-4.131591.tar.gz
Checking prerequisites...
recommends:
* Unicode::UTF8 is not installed
ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions
of the modules indicated above before proceeding with this installation
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'File-Util' version '4.131591'
Building File-Util
TOMMY/File-Util-4.131591.tar.gz
./Build -- OK
'YAML' not installed, will not store persistent state
Running Build test
t/00-compile.t .................. ok
t/000-report-versions-tiny.t .... #
#
# Generated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.08
# perl: 5.014002 (wanted 5.008001) on linux from /usr/bin/perl
#
# AutoLoader => 5.71 (want any version)
# Config => <undef> (want any version)
# Cwd => 3.36 (want any version)
# Devel::Cover => module not found. (want any version)
# Dist::Zilla => module not found. (want any version)
# Exporter => 5.64_03 (want any version)
# ExtUtils::MakeMaker => 6.57_05 (want 6.30)
# Fcntl => 1.11 (want any version)
# File::Find => 1.19 (want any version)
# File::Temp => 0.22 (want any version)
# Module::Build => 0.38 (want 0.3601)
# Perl::Critic => module not found. (want any version)
# Perl::Critic::Lax => module not found. (want any version)
# Pod::Coverage::TrustPod => module not found. (want any version)
# Scalar::Util => 1.23 (want any version)
# Test => 1.25_02 (want any version)
# Test::CPAN::Changes => module not found. (want 0.19)
# Test::CPAN::Meta => module not found. (want any version)
# Test::Fatal => module not found. (want any version)
# Test::More => 0.98 (want 0.88)
# Test::NoWarnings => 1.04 (want any version)
# Test::Pod => module not found. (want 1.41)
# Test::Pod::Coverage => module not found. (want 1.08)
# Unicode::UTF8 => module not found. (want 0.58)
# constant => 1.21 (want any version)
# strict => 1.04 (want any version)
# subs => 1.00 (want any version)
# utf8 => 1.09 (want any version)
# vars => 1.02 (want any version)
# version => 0.88 (want 0.9901)
# warnings => 1.12 (want any version)
#
# Thanks for using my code. I hope it works for you.
# If not, please try and include this output in the bug report.
# That will help me reproduce the issue and solve your problem.
#
t/000-report-versions-tiny.t .... ok
t/001_canuseit.t ................ ok
t/002_isa.t ..................... ok
t/003_can.t ..................... ok
t/004_portable.t ................ ok
t/005_ftests.t .................. ok
t/006_io.t ...................... ok
t/007_flock.t ................... ok
t/008_export_ok.t ............... ok
t/009_empty_subclass.t .......... ok
t/010_unicode.t ................. ok
t/011_abspaths.t ................ ok
t/012_atomize_path.t ............ ok
t/013_interface_classic.t ....... ok
t/014_interface_modern.t ........ ok
t/015_destroy.t ................. ok
t/016_new.t ..................... ok
t/017_make_dir_list_dir.t ....... ok
t/018_list_dir_advancedmatch.t .. ok
t/019_load_dir.t ................ ok
t/020_write_file.t .............. ok
All tests successful.
Files=22, Tests=409, 3 wallclock secs ( 0.08 usr 0.04 sys + 0.90 cusr 0.16 csys = 1.18 CPU)
Result: PASS
TOMMY/File-Util-4.131591.tar.gz
./Build test -- OK
Running Build install
Building File-Util
Installing /usr/local/share/perl/5.14.2/File/Util.pm
Installing /usr/local/man/man3/File::Util.3pm
TOMMY/File-Util-4.131591.tar.gz
sudo ./Build install -- OK
Message body is not shown because it is too large.