summaryrefslogtreecommitdiff
path: root/sample/trap.pl
diff options
context:
space:
mode:
Diffstat (limited to 'sample/trap.pl')
-rw-r--r--sample/trap.pl6
1 files changed, 6 insertions, 0 deletions
diff --git a/sample/trap.pl b/sample/trap.pl
new file mode 100644
index 0000000..ce022d4
--- /dev/null
+++ b/sample/trap.pl
@@ -0,0 +1,6 @@
+$SIG{'INT'} = 'test';
+
+while (<>) {
+ print;
+}
+sub test { print "C-c handled\n"; }