™.. Fatal - Online Linux Manual PageSection : 3pm
Updated : 2009-07-25
Source : perl v5.10.1
Note : Perl Programmers Reference Guide
NAMEFatal − Replace functions with equivalents which succeed or die
SYNOPSIS use Fatal qw(open close);
open(my $fh, "<", $filename); # No need to check errors!
use File::Copy qw(move);
use Fatal qw(move);
move($file1, $file2); # No need to check errors!
sub juggle { . . . }
Fatal−>import('juggle');
BEST PRACTICEFatal has been obsoleted by the new autodie pragma. Please use autodie in preference to \*(C`Fatal\*(C'\fR. autodie supports lexical scoping, throws real exception objects, and provides much nicer error messages. The use of \*(C`:void\*(C'\fR with Fatal is discouraged.
DESCRIPTION\*(C`Fatal\*(C'\fR provides a way to conveniently replace functions which normally return a false value when they fail with equivalents which raise exceptions if they are not successful. This lets you use these functions without having to test their return values explicitly on each call. Exceptions can be caught using \*(C`eval{}\*(C'\fR. See perlfunc and perlvar for details. The do-or-die equivalents are set up simply by calling Fatal's \*(C`import\*(C'\fR routine, passing it the names of the functions to be replaced. You may wrap both user-defined functions and overridable CORE operators (except \*(C`exec\*(C'\fR, \f(CW\*(C`system\*(C'\fR, \f(CW\*(C`print\*(C'\fR, or any other built-in that cannot be expressed via prototypes) in this way. If the symbol \*(C`:void\*(C'\fR appears in the import list, then functions named later in that import list raise an exception only when these are called in void context\*(--that is, when their return values are ignored. For example use Fatal qw/:void open close/;
# properly checked, so no exception raised on error
if (not open(my $fh, '<', '/bogotic') {
warn "Can't open /bogotic: $!";
}
# not checked, so error raises an exception
close FH;
The use of \*(C`:void\*(C'\fR is discouraged, as it can result in exceptions not being thrown if you accidentally call a method without void context. Use autodie instead if you need to be able to disable autodying/Fatal behaviour for a small block of code.
DIAGNOSTICSBad subroutine name for Fatal: %s You've called \*(C`Fatal\*(C'\fR with an argument that doesn't look like a subroutine name, nor a switch that this version of Fatal understands. %s is not a Perl subroutine You've asked \*(C`Fatal\*(C'\fR to try and replace a subroutine which does not exist, or has not yet been defined. %s is neither a builtin, nor a Perl subroutine You've asked \*(C`Fatal\*(C'\fR to replace a subroutine, but it's not a Perl built-in, and \*(C`Fatal\*(C'\fR couldn't find it as a regular subroutine. It either doesn't exist or has not yet been defined. Cannot make the non-overridable %s fatal You've tried to use \*(C`Fatal\*(C'\fR on a Perl built-in that can't be overridden, such as \*(C`print\*(C'\fR or \f(CW\*(C`system\*(C'\fR, which means that \*(C`Fatal\*(C'\fR can't help you, although some other modules might. See the ‟SEE ALSO” section of this documentation. Internal error: %s You've found a bug in \*(C`Fatal\*(C'\fR. Please report it using the \*(C`perlbug\*(C'\fR command.
BUGS\*(C`Fatal\*(C'\fR clobbers the context in which a function is called and always makes it a scalar context, except when the \*(C`:void\*(C'\fR tag is used. This problem does not exist in autodie. ‟Used only once” warnings can be generated when \*(C`autodie\*(C'\fR or \f(CW\*(C`Fatal\*(C'\fR is used with package filehandles (eg, \*(C`FILE\*(C'\fR). It's strongly recommended you use scalar filehandles instead.
AUTHOROriginal module by Lionel Cons (CERN). Prototype updates by Ilya Zakharevich <ilya@math.ohio−state.edu>. autodie support, bugfixes, extended diagnostics, \*(C`system\*(C'\fR support, and major overhauling by Paul Fenwick <pjf@perltraining.com.au>
LICENSEThis module is free software, you may distribute it under the same terms as Perl itself.
SEE ALSOautodie for a nicer way to use lexical Fatal. IPC::System::Simple for a similar idea for calls to \*(C`system()\*(C'\fR and backticks. 0
Johanes Gumabo
Data Size : 14,914 byte
man-Fatal.3pmBuild : 2024-12-29, 07:25 :
Visitor Screen : x
Visitor Counter ( page / site ) : 5 / 255,563
Visitor ID : :
Visitor IP : 3.149.241.93 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.29
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.
ERROR : Need New Coding : (parse_manual_page_|252|Fatal.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\|
) (htmlprn|149|Fatal.3pm|36/37|.el══─{─══. ds -- — |.el══─{─══. ds -- \|\(em\|
) (parse_manual_page_|252|Fatal.3pm|41|br══─}─══|'br══─}─══
) (htmlprn|149|Fatal.3pm|41|'br══─}─══ |'br══─}─══
) (rof_nr_x|149|Fatal.3pm|51/52|\nF|.ie \nF ══─{─══. de IX
) (rof_unit_scale_px|41|Fatal.3pm|51/52|F|.ie \nF ══─{─══. de IX
) (rof_if|19|Fatal.3pm|51/52|\nF|.ie \nF ══─{─══. de IX
) (htmlprn|149|Fatal.3pm|51/52|.ie \nF ══─{─══. de IX|.ie \nF ══─{─══. de IX
) (rof_escape_sequence|91|Fatal.3pm|53|\$1\t\\n%\t"\\$2" |. tm Index:\\$1\t\\n%\t"\\$2"
) (parse_manual_page_|252|Fatal.3pm|57|══─}─══|.══─}─══
) (htmlprn|149|Fatal.3pm|57|.══─}─══ |.══─}─══
) (rof_escape_sequence|91|Fatal.3pm|152|\*(C`Fatal\*(C'\fR. autodie supports lexical scoping, |autodie in preference to \f(CW\*(C`Fatal\*(C'\fR. autodie supports lexical scoping,
) (rof_escape_sequence|91|Fatal.3pm|155|\*(C`:void\*(C'\fR with Fatal is discouraged. |The use of \f(CW\*(C`:void\*(C'\fR with Fatal is discouraged.
) (rof_escape_sequence|91|Fatal.3pm|158|\*(C`Fatal\*(C'\fR provides a way to conveniently replace |\&\f(CW\*(C`Fatal\*(C'\fR provides a way to conveniently replace
) (rof_escape_sequence|91|Fatal.3pm|163|\*(C`eval{}\*(C'\fR. See perlfunc and perlvar for details. |\&\f(CW\*(C`eval{}\*(C'\fR. See perlfunc and perlvar for details.
) (rof_escape_sequence|91|Fatal.3pm|166|\*(C`import\*(C'\fR routine, passing it the names of the functions to be |\&\f(CW\*(C`import\*(C'\fR routine, passing it the names of the functions to be
) (rof_escape_sequence|91|Fatal.3pm|168|\*(C`exec\*(C'\fR, \f(CW\*(C`system\*(C'\fR, \f(CW\*(C`print\*(C'\fR, or any other |\&\s-1CORE\s0 operators (except \f(CW\*(C`exec\*(C'\fR, \f(CW\*(C`system\*(C'\fR, \f(CW\*(C`print\*(C'\fR, or any other
) (rof_escape_sequence|91|Fatal.3pm|171|\*(C`:void\*(C'\fR appears in the import list, then functions |If the symbol \f(CW\*(C`:void\*(C'\fR appears in the import list, then functions
) (rof_escape_sequence|91|Fatal.3pm|173|\*(--that is, when their return |these are called in void context\*(--that is, when their return
) (rof_escape_sequence|91|Fatal.3pm|188|\*(C`:void\*(C'\fR is discouraged, as it can result in exceptions |The use of \f(CW\*(C`:void\*(C'\fR is discouraged, as it can result in exceptions
) (rof_escape_sequence|91|Fatal.3pm|197|\*(C`Fatal\*(C'\fR with an argument that doesn't look like |You've called \f(CW\*(C`Fatal\*(C'\fR with an argument that doesn't look like
) (rof_escape_sequence|91|Fatal.3pm|203|\*(C`Fatal\*(C'\fR to try and replace a subroutine which does not |You've asked \f(CW\*(C`Fatal\*(C'\fR to try and replace a subroutine which does not
) (rof_escape_sequence|91|Fatal.3pm|208|\*(C`Fatal\*(C'\fR to replace a subroutine, but it's not a Perl |You've asked \f(CW\*(C`Fatal\*(C'\fR to replace a subroutine, but it's not a Perl
) (rof_escape_sequence|91|Fatal.3pm|209|\*(C`Fatal\*(C'\fR couldn't find it as a regular subroutine. |built-in, and \f(CW\*(C`Fatal\*(C'\fR couldn't find it as a regular subroutine.
) (rof_escape_sequence|91|Fatal.3pm|214|\*(C`Fatal\*(C'\fR on a Perl built-in that can't be |You've tried to use \f(CW\*(C`Fatal\*(C'\fR on a Perl built-in that can't be
) (rof_escape_sequence|91|Fatal.3pm|215|\*(C`print\*(C'\fR or \f(CW\*(C`system\*(C'\fR, which means that |overridden, such as \f(CW\*(C`print\*(C'\fR or \f(CW\*(C`system\*(C'\fR, which means that
) (rof_escape_sequence|91|Fatal.3pm|216|\*(C`Fatal\*(C'\fR can't help you, although some other modules might. |\&\f(CW\*(C`Fatal\*(C'\fR can't help you, although some other modules might.
) (rof_escape_sequence|91|Fatal.3pm|221|\*(C`Fatal\*(C'\fR. Please report it using |You've found a bug in \f(CW\*(C`Fatal\*(C'\fR. Please report it using
) (rof_escape_sequence|91|Fatal.3pm|222|\*(C`perlbug\*(C'\fR command. |the \f(CW\*(C`perlbug\*(C'\fR command.
) (rof_escape_sequence|91|Fatal.3pm|225|\*(C`Fatal\*(C'\fR clobbers the context in which a function is called and always |\&\f(CW\*(C`Fatal\*(C'\fR clobbers the context in which a function is called and always
) (rof_escape_sequence|91|Fatal.3pm|226|\*(C`:void\*(C'\fR tag is used. |makes it a scalar context, except when the \f(CW\*(C`:void\*(C'\fR tag is used.
) (rof_escape_sequence|91|Fatal.3pm|229|\*(C`autodie\*(C'\fR or \f(CW\*(C`Fatal\*(C'\fR |\&\*(L"Used only once\*(R" warnings can be generated when \f(CW\*(C`autodie\*(C'\fR or \f(CW\*(C`Fatal\*(C'\fR
) (rof_escape_sequence|91|Fatal.3pm|230|\*(C`FILE\*(C'\fR). It's strongly recommended |is used with package filehandles (eg, \f(CW\*(C`FILE\*(C'\fR). It's strongly recommended
) (rof_escape_sequence|91|Fatal.3pm|238|\*(C`system\*(C'\fR |autodie support, bugfixes, extended diagnostics, \f(CW\*(C`system\*(C'\fR
) (rof_escape_sequence|91|Fatal.3pm|248|\*(C`system()\*(C'\fR |IPC::System::Simple for a similar idea for calls to \f(CW\*(C`system()\*(C'\fR
)