#!/usr/local/perl/5.10.0/bin/perl use strict; use warnings; use POSIX; use Data::Dumper; $Data::Dumper::Useqq = 1; my $inf; my $sender_pid; POSIX::sigaction( SIGINT, POSIX::SigAction->new( sub { $inf = Dumper \@_; $sender_pid = unpack "x16S", $_[2]; # <-- }, 0, POSIX::SA_SIGINFO ), ); kill 'INT', $$; print $inf; print "Sender PID: $sender_pid\n"; print "Own PID: $$\n"; __END__ $VAR1 = [ "INT", { "code" => 0, "signo" => 2 }, "\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0RQ\0\0005\4\0\0\270\273}\0\0\0\0\0`\257i\0\0\0\0\0\3342E\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\370\25e\0\0\0\0\0\30 e\0\0\0\0\0\1\0\0\0\0\0\0\0\r\0\0\0\0\0\0\0\360b8\213\377\177\0\0\370b8\213\377\177\0\0\1\0\0\0\0\0\0\0\3IM\0\0\0\0\0" ]; Sender PID: 20818 (as we're sending the signal ourself, the sender is $$) Own PID: 20818