Hi Jacob,
I would recommend using DBD::Informix instead, more elegant of course.
Not sure why you need the pipe if you are producing an unload to a file. (if you need just the exit code, a system call would be sufficient from my perspective.)
Redirect output of the system call if you want to examine any error from the output.
Something like
system ("(echo \"unload to '/tmp/test.unl' delimiter ... select ....\" | dbaccess ${DB}) 2>&1 > /tmp/xxxx.out").
if ( $? -eq 0) {
.... exit code was 0, do something with the unl
}
If I remember right, a trailing | will allow you to read the output in perl.
open (DB, "echo \"select ...\" | dbaccess ${DBNAME} |");
while <DB> ....
close (DB);
Best,
Marcus