Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^4: problem with do and file existence.

by emilford (Friar)
on Oct 04, 2005 at 15:57 UTC ( [id://497306]=note: print w/replies, xml ) Need Help??


in reply to Re^3: problem with do and file existence.
in thread problem with do and file existence.

It doesn't cause a return, but it is the last bit of code executed in x.cgi. By why would the file not existing cause x.cgi to return undef? How can this be resolved?
  • Comment on Re^4: problem with do and file existence.

Replies are listed 'Best First'.
Re^5: problem with do and file existence
by sauoq (Abbot) on Oct 04, 2005 at 16:02 UTC

    I was updating as you replied. The last expression evaluated is the value returned by do. If it is undef, then you can't tell it apart from the times when do returns an undef because the file doesn't compile or doesn't exist.

    If that if clause is the last thing being evaluated, and the file doesn't exist, it is evaluating to undef and being returned. (And setting $! to boot.) You can probably take care of it with else { return 0 } or similar.

    -sauoq
    "My two cents aren't worth a dime.";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://497306]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-25 05:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found