summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes2
-rw-r--r--lib/Mixin/Linewise/Readers.pm2
2 files changed, 3 insertions, 1 deletions
diff --git a/Changes b/Changes
index a594e30..995fb86 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,8 @@
Changelog for Mixin-Linewise
{{$NEXT}}
+ - tweak the file test again to exclude directories; (is this going to
+ turn into something more convoluted in several releases? probably)
0.109 2021-06-20 21:10:22-04:00 America/New_York
- use "-r" test instead of "-f" test, to allow use on (say) named
diff --git a/lib/Mixin/Linewise/Readers.pm b/lib/Mixin/Linewise/Readers.pm
index 057fa3e..9ac4785 100644
--- a/lib/Mixin/Linewise/Readers.pm
+++ b/lib/Mixin/Linewise/Readers.pm
@@ -95,7 +95,7 @@ sub _mk_read_file {
# Check the file
Carp::croak "no filename specified" unless $filename;
Carp::croak "file '$filename' does not exist" unless -e $filename;
- Carp::croak "'$filename' is not readable" unless -r _;
+ Carp::croak "'$filename' is not readable" unless -r _ && ! -d _;
my $handle = IO::File->new($filename, "<:$binmode")
or Carp::croak "couldn't read file '$filename': $!";