Subject: | File::Slurp::Tiny v0.003 read_dir |
Date: | Mon, 24 Mar 2014 04:36:39 -0700 (PDT) |
To: | "bug-File-Slurp-Tiny [...] rt.cpan.org" <bug-File-Slurp-Tiny [...] rt.cpan.org> |
From: | John Wiersba <jrw32982 [...] yahoo.com> |
Hi, Leon,
I was just looking at the source for File::Slurp::Tiny (v0.003) and found that read_dir() has a bug. Read_dir() fails to return a filename like ".\n" or "..\n" (where \n is newline). For this reason, I (almost) never use "$" in a regex without /m -- I always use "\z".
To reproduce:
mkdir junk &&
cd junk >/dev/null &&
touch x $'.\n' &&
perl -e ' use File::Slurp::Tiny qw(read_dir); print "<$_>\n" for read_dir "." '
Thanks!
-- John