in reply to Re^2: Finding if files exist when names randomly have letters in both upper and lower cases
in thread Finding if files exist when names randomly have letters in both upper and lower cases
Thou Shalt Not Use Scalar Glob Unless Thou Understandest Thy Problems Perfectly.use File::Glob qw(:globally :nocase); if(<$file>) {
In layman's terms, your test will work "every other time" mysteriously.
In real terms, what's happening is that a scalar glob context is established on the first hit, and then reused on the second hit, so you'll get your filename, then undef, then your filename, then undef, then your filename. Ick.
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|