>>430
それだと、ループの中に処理が移らないとlastが機能しないので、
割り込みでdieを投げる。

use Try::Tiny;

local $SIG{INT} = sub{ die 'SIGINT' };

try {
    while(<STDIN>){
        ...
    }
} catch {
    /^SIGINT/ or die $_;
    print "Break.\n";
}