[...] { # Declare variables my $fifo; # The pipe from which we'll read my $input; # Text which SEC handed us my $clean; # $input stripped of annoying characters my $text; # $clean, stripped of the log name MAIN_LOOP: while (1) { # Open pipe ualarm(0); unless (open $fifo, '<', $pipe) { log_it("Cannot open $pipe: $!"); sleep 5; next MAIN_LOOP; } # Give ourselves .01s to read input ualarm(10000); $input = <$fifo>; next MAIN_LOOP unless defined $input; chomp $input; # Process input alarm(0); next MAIN_LOOP unless $clean = strip_junk($input); next MAIN_LOOP unless $log = find_log_name($clean); ($text) = ($clean) =~ /^\w+\s+(.*)/; write_line($text); } } [...]