author | Cezary Kaliszyk <cezarykaliszyk@gmail.com> |
Wed, 04 Apr 2012 20:10:21 +0200 | |
changeset 47364 | 637074507956 |
parent 41616 | aa002926cbf1 |
child 47868 | 32c03d45fffe |
permissions | -rw-r--r-- |
# # Author: Markus Wenzel, TU Muenchen # # feeder.pl - feed isabelle session # # args ($head, $emitpid, $quit, $tail) = @ARGV; # setup signal handlers sub hangup { exit(0); } $SIG{'HUP'} = "hangup"; $SIG{'INT'} = "IGNORE"; # main #buffer lines $| = 1; $emitpid && (print $$, "\n"); if ($head) { utf8::upgrade($head); $head =~ s/([\x80-\xff])/\\${\(ord($1))}/g; print $head, "\n"; } if (!$quit) { while (<STDIN>) { print; } } $tail && (print "$tail", "\n"); # wait forever close STDOUT; sleep;