From c7175d0b155580e8422054b5175c8d6e71b8b1d9 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Fri, 16 May 2025 22:07:32 +0300 Subject: [PATCH] die, croak, carp, confess and *mess MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit В Perl я знал и использовал функцию die() постоянно, типа как exception выкидывал ею. Но вот в Perl Best Practices рекомендуют croak. Люблю я когда с юмором подходят к разработке и именованию. NAME Carp - alternative warn and die for modules SYNOPSIS use Carp; # warn user (from perspective of caller) carp "string trimmed to 80 chars"; # die of errors (from perspective of caller) croak "We're outta here!"; # die of errors with stack backtrace confess "not implemented"; # cluck, longmess and shortmess not exported by default use Carp qw(cluck longmess shortmess); cluck "This is how we got here!"; # warn with stack backtrace $long_message = longmess( "message from cluck() or confess()" ); $short_message = shortmess( "message from carp() or croak()" ); -- 2.51.0