use strict; use warnings; use Gtk2 '-init'; my $toplevel = Gtk2::Window->new ('toplevel'); my $button = Gtk2::LinkButton->new ('http://localhost/index.html', 'Click to throw an error'); $toplevel->add ($button); Glib->install_exception_handler (sub { print "exception handler\n"; }); Gtk2::LinkButton->set_uri_hook (sub { print "uri hook\n"; die "some error\n"; }); $toplevel->show_all; Gtk2->main; print "exit 0\n"; exit 0;