while (1 == 1) { open FIFO, "/home/steve/.tmp/pipe"; foreach () { @args = split / /; foreach (@args) { print; } print "\n"; if (@args[0] == "plane") { print "plane @args[1]"; } } } in bash: ~$ echo "fffff left" > .tmp/pipe output is: fffffleft plane left