in reply to Re: From chat to here :) chdir() and test -f issues.
in thread From chat to here :) chdir() and test -f issues.

Yup. Already did this. And from the command line it works fine. BTW, I am running the script as the user that is running the script or in other words, I have pretty much eliminated a permissions issue. Anyway, I am getting closer and I believe those of you who stated that there maybe a hidden character somewhere must be on the right track...

[qadmin@concon qw]$ perl -e ' $gamedir = "fortress"; $HOME = $ENV{'HOME'}; $mapname = "2fort5"; if ( -f "$HOME/$gamedir/maps/$mapname.bsp" ) { print "It exists!\n" } +else { print "$!\n" }; ' It exists! [qadmin@concon qw]$ perl -e ' $gamedir = "fortress"; $HOME = $ENV{'HOME'}; $mapname = "2fort5qra"; if ( -f "$HOME/$gamedir/maps/$mapname.bsp" ) { print "It exists!\n" } +else { print "$!\n" }; ' No such file or directory [qadmin@concon qw]$

Since the script uses other means whereby to get these values and it doesn't work vs my putting these values in by hand where I know there are no hidden characters I can deduce that there must be some hidden character slipping in somewhere in the runtime of the script. I don't see why there would be a '\r' in this thing but it is possible so I will try that out and see how I fare. A '\r' seems like the most logical thing that could be flubbing this up.

Thanks fellow monks. I will let everyone know the outcome once I am done.

----------
- Jim