in reply to Replace filename with pipe in program argument?

Ok, got it now, and it works properly :)

unless (defined ($pid = fork)) { die "cannot fork: $!"; } unless ($pid) { my @args=(); @args=("$pipeline/EXE/searchXY", "-5", "UEB2K005I", "locate", "234 +", "156", "4", "Print"); system(@args); exit; # the child stops here } open(FIFO, "<$pipeline/OUT/locateXY"); my $line; while ($line = <FIFO>) { print "rep $line"; #or whatever here } close(FIFO); waitpid($pid, 0); #clean up

Now I just need a good reference/tutorial on fork to understand this properly :)

P.S. At some points you may want to add the two following lines, at appropriate places, before and after you use the above code, respectively:

system "/usr/bin/mkfifo $pipeline/OUT/locateXY"; system "chmod 777 $pipeline/OUT/locateXY"; #as needed system "rm $pipeline/OUT/locateXY"; #to clean up if required