in reply to Re^2: problem with do and file existence.
in thread problem with do and file existence.
Yes, that makes much more sense. Your problem is that the -e is setting $! when the file doesn't exist. It's staying set when you get back to your homepage.cgi. And apparently your x.pl script is returning undef. I'd check the logic in x.pl to see if that new if statement causes a return.
Update: To elaborate, if you want to do manual error checking like that, it's necessary for you to return something useful from the file you do. Otherwise, the last expression evaluated in the file will be your return value. If that value is undef, you can't tell it apart from those times when do returns undef because of an error or a non-existent file.
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: problem with do and file existence.
by emilford (Friar) on Oct 04, 2005 at 15:57 UTC | |
by sauoq (Abbot) on Oct 04, 2005 at 16:02 UTC |