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?
In reply to Re: Catching INT in Term::ReadLine::Gnu->readline()
by hippo
in thread Catching INT in Term::ReadLine::Gnu->readline()
by mbrouillet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |