Acme-Warn-LOLCAT

 view release on metacpan or  search on metacpan

lib/Acme/Warn/LOLCAT.pm  view on Meta::CPAN

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use Acme::LOLCAT qw(translate);
 
our $VERSION = '0.02';
 
# Intrusive lolcat is intrusive
no warnings 'redefine';
*CORE::GLOBAL::warn =
$main::SIG{__WARN__} = sub{
    my $message = shift || "Warning: something's wrong";
 
    my (undef, $file, $line) = caller(0);
    $message .= " at $file line $line\n" unless ($message =~ /\n$/);
 
    $message = translate($message);
    $message =~ s/\n\.  KTHXBYE!//g;
    $message =~ s/\n\.  KTHX.//g;
 
    CORE::warn($message);
};
 
1;



( run in 0.237 second using v1.01-cache-2.11-cpan-0d8aa00de5b )