$ x86_64-linux-gnu-gcc 2.perl_embed_argv_signal.c -Wl,-E -fstack-protector-strong -I/usr/lib/x86_64-linux-gnu/perl/5.26.1/CORE -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.26.1/CORE -lperl -ldl -lm -lpthread -lc -lcrypt -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -o embedex2 $ ./embedex2 slithy toves wirr and wimbel ./embedex2 : perl_alloc() ./embedex2 : perl_construct() ./embedex2 : executing : $SIG{INT} = sub { print "Caught your ctrl-c and exiting!\n"; exit(0); }; #$SIG{INT} = sub { print "Caught your ctrl-c but ignoring it!\n" }; print "$0: ARGV:"; print ' '.$_ foreach(@ARGV); print "\n"; print "my pid $$\n"; print "now sleeping, and you ctrl-c me\n"; for(1..15){sleep(1);print"$_\n";} -e: ARGV: slithy toves wirr and wimbel my pid 21094 now sleeping, and you ctrl-c me 1 2 3 4 5 ^CCaught your ctrl-c and exiting! $