http://www.perlmonks.org?node_id=11102344


in reply to Catching INT in Term::ReadLine::Gnu->readline()

Your code as supplied works for me in that it produces the output which I believe you were expecting:

$ perl cctrap.pl Term::ReadLine::Stub try CTRL-C in some text here :abcd^C caught CODE(0x194e9a0)INT xyz $

The input sequence is: abcd^Cxyz<RETURN>

This runs with perl v5.20.3 and Term::ReadLine 1.14 from bash on Linux. Maybe you just need to avoid Term::ReadLine::Gnu?