or download this
Be careful to check both the open() and the close() return values. If
+you're writing to a pipe, you should also trap SIGPIPE. Otherwise, th
+ink of what happens when you start up a pipe to a command that doesn'
+t exist: the open() will in all likelihood succeed (it only reflects
+the fork()'s success), but then your output will fail--spectacularly.
+ Perl can't know whether the command worked because your command is a
+ctually running in a separate process whose exec() might have failed.