Here is a solution that involves a minimal edit to your existing code:
open( FILE, "$file" ) || error_message( "File can not be opened: Line __LINE__.\n" );
But when debugging CGI scripts, CGI::Carp can be much more useful, and would enable you to use die while dumping fatal error messages to the browser.
Update:
Dumb mistake here: __LINE__ doesn't interpolate (nor should it). See my followup: Re^3: cgi code line message. Apologies!
Dave
In reply to Re: cgi code line message
by davido
in thread cgi code line message
by Murcia
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |