diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2008-11-12 18:04:39 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2008-11-12 18:04:39 +0000 |
commit | 877c64a08cb78e0558620cfc76589a8239b2462f (patch) | |
tree | 8b906c962cacf956fde1dd4fbec6ea75ebb34dc9 | |
parent | e39a087979a4cac8724ba78ba86ae047c0664054 (diff) | |
download | irssi-877c64a08cb78e0558620cfc76589a8239b2462f.zip |
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
-rw-r--r-- | src/perl/irssi-core.pl | 4 |
1 files changed, 4 insertions, 0 deletions
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; }}; { |