in reply to Re^2: [Windows] Given lower-cased file name, how to get actual file name (stored on filesystem) ?in thread [Windows] Given lower-cased file name, how to get actual file name (stored on filesystem) ?
$ md tmpblah
$ echo > tmpblah\aone.pl
$ echo > tmpblah\bOne.pl
$ echo > tmpblah\cONe.pl
$ echo > tmpblah\dONE.pl
$ perl -MPath::Class::Rule -le "print for Path::Class::Rule->new->file
Ah, I thought there would be an approach not involving ->all, which is IMO not different from just using grep /one.pl/ readdir $foo. But at least it has a nice syntax. I was hoping for something more direct there.
$ perl -MFile::Spec -le " print File::Spec->rel2abs( shift ) " tmp\tmp
$ perl -MPath::Class -le " print file( shift )->resolve " tmp\tmpblah\
$ perl -MPath::Class -le " print file( shift )->resolve->absolute " tm
Fruit and Vegetables
Me, that's why I'm so cool
Logic (separated into Horror and Brilliance)
Results (258 votes). Check out past polls.