Subject: | avoid warnings at -w mode |
File::ShareDir cause some warnings.
Because,
- dist_dir_new returns undef if a module uses legacy path
- if user uses -w, File::Spec shouts a lot of warnings :(
=== lib/File/ShareDir.pm
==================================================================
--- lib/File/ShareDir.pm (revision 28048)
+++ lib/File/ShareDir.pm (local)
@@ -322,6 +322,7 @@
# If it exists, what should the path be
my $dir = _dist_dir_new( $dist );
+ return undef unless defined $dir;
my $path = File::Spec->catfile( $dir, $file );
# Does the file exist