On Jan 21, Alex Harris said:
>I need to place code that leaves my program entirely if certain errors occur
>(mostly on opening a file). However I don't want ANY messages going
>anywhere except my $errlog. (I noticed die, seem to always show a message
>at the command line). What's the best way to handle say the following then
>if an error occurs?
Then create a function that does the error-handling you want.
sub fatal {
my ($file, $line) = (caller)[1,2];
print ERROR "In $file on line $line: ", @_, "\n";
exit;
}
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]