If your filesystem is not case sensitive, then -f should just work with the upper case names, if your filesystem is case sensitive, and the case from the database doesn't match what is on the filesystem, then you don't have a file with that name.
If your filesystem is case sensitive, and you still have to do this, you will have to break filename up into parts, search through each directory from the root, and look to see if any of the directories along the way match the one you are looking for (probably by converting the argument and the directories into the same case using uc() or lc().)
You are likely to get more help here though if you post some of the things you have tried, instead of just asking for someone to do it for you.
| We're not surrounded, we're in a target-rich environment! |
|---|
| [reply] [d/l] [select] |
use File::Glob qw(:globally :nocase);
# instead of if(-f $file) {
if(<$file>) {
| We're not surrounded, we're in a target-rich environment! |
|---|
| [reply] [d/l] |
use File::Glob qw(:globally :nocase);
if(<$file>) {
Thou Shalt Not Use Scalar Glob Unless Thou Understandest Thy Problems Perfectly.
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.
update:
And it was also pointed out to me in the CB that this is a readline() call, not a glob() call, which really wouldn't have worked.
| [reply] [d/l] |
Many thanks for your suggestions.
I do appreciate your last comment and I would have done so
had I thought any of my efforts were worthy of posting.
| [reply] |
not sure if this is a viable solution for you:
given a file name "TEST" (from the db), the simple *NIX command ls -l [Tt][Ee][Ss][Tt] would work. There's probably a better way, but that springs to mind off the top of my head. | [reply] [d/l] |
| [reply] [d/l] [select] |