in reply to Re: Problems executing a (bioperl) script from another script
in thread Problems executing a (bioperl) script from another script

This is the last paragraph in the man page that you get when you run "perldoc -f close":
Prematurely closing the read end of a pipe (i.e. before the process writing to it at the other end has closed it) will result in a SIGPIPE being delivered to the writer. If the other end can’t handle that, be sure to read all the data before closing the pipe.

I think this is relevant to your case. You don't seem to be reading anything from the pipe file handle after you open it, so maybe you don't really want to use open( $fh, "-|", $command ) in this case -- use a system call instead.

If you actually do need to read output from the command, just read from the file with the usual  while (<$fh>) {...} idiom, or use "slurp" mode on the pipe file handle. In either case, EOF will be detected when the sub-process finishes -- just don't close it before that happens.