Skip to content

Instantly share code, notes, and snippets.

@nekokak
Created January 12, 2012 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nekokak/1599631 to your computer and use it in GitHub Desktop.
Save nekokak/1599631 to your computer and use it in GitHub Desktop.
#! perl
use strict;
use warnings;
use DBI;
use Sys::SigAction qw(set_sig_handler);
my $h = set_sig_handler(
'ALRM',
sub {
print "fire\n";
},
);
#$SIG{ALRM} = sub { print "fire\n"; };
my $dbh = DBI->connect('dbi:mysql:test', 'root', '');
alarm(3);
$dbh->do('select sleep(10)');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment