Perl Signal Handler

I was working on some Perl code that does signal handling and I came across this one liner and wasn't sure what it was doing.

local $SIG{__DIE__} = sub {$! = 2; die $_[0];};

I think the first part of the anonymous subroutine is setting $! to 2, but I am not sure what the second part is doing. Can someone explain this to me.

Thanks

perl -e ' 
         use POSIX;
         $!=EINTR; 
         print strerror $!;
         die $_[0];'
echo "  return code from perl =  $?"

Instead of using defined error numbers, the coder decided to use a signal number as the return code from the perl code. SIGINT (EINTR) == 2 on most systems.