From 877c64a08cb78e0558620cfc76589a8239b2462f Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Wed, 12 Nov 2008 18:04:39 +0000 Subject: Add perl __WARN__ handler for scripts, bug #427. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4898 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/perl/irssi-core.pl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/perl') diff --git a/src/perl/irssi-core.pl b/src/perl/irssi-core.pl index 11aa0f6f..50c2933f 100644 --- a/src/perl/irssi-core.pl +++ b/src/perl/irssi-core.pl @@ -21,6 +21,10 @@ sub eval_data { my ($data, $id) = @_; destroy("Irssi::Script::$id"); + $SIG{__WARN__} = sub { + Irssi::print("Warning in script $id:"); + print $_[0]; + }; my $package = "Irssi::Script::$id"; my $eval = qq{package $package; %s sub handler { $data; }}; { -- cgit v1.2.3