Perl Cd Bookshelf [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Perl Cd Bookshelf [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید

32.16. Fatal


The Fatal module makes functions fail more
spectacularly. It replaces functions that normally return false
upon failure with wrappers that raise an exception if the real
function returns false. That way you can safely use these functions
without testing their return values explicitly on each call.

Both user-defined functions and built-in functions may be wrapped,
except for those built-ins that cannot be expressed via prototypes.
Attempting to override a nonoverridable built-in raises an exception.
These include system, print, printf, exec, split,
grep, and map--or more generally, any FUNC for which
prototype "CORE::FUNC" returns false, including the
prototype function itself.

If the symbol :void appears in the import list, functions named
later in the list are limited to raising an exception when the function
is called in void context--that is, when the return value is ignored.
(Be careful about the last statement in a subroutine.) For example:


use Fatal qw(:void open close);
# open properly checked, so no exception is raised on failure.
if (open(FH, "< /nonesuch") { warn "no /nonesuch: $!"; }
# close not properly checked, so failure raises an exception.
close FH;







/ 875