G
g4173c
Hi:
I found this bit of code on this news group from Tom Christiansen and
thought it would work very well is my perl script, however I get a
syntax error and can't figure out why? Here's the code:
system {
exec 3>&1;
exit `( (myprogram; echo $? 1>&4 3>&- 4>&-) |
tee afile.log 1>&3 3>&- 4>&1 ) 4>&1`;
};
if ($?) { warn "myprogram failed: $?" }
The error:
syntax error at zz line 9, near "};"
Any ideas?
Thanks in Advance
Tom
I found this bit of code on this news group from Tom Christiansen and
thought it would work very well is my perl script, however I get a
syntax error and can't figure out why? Here's the code:
system {
exec 3>&1;
exit `( (myprogram; echo $? 1>&4 3>&- 4>&-) |
tee afile.log 1>&3 3>&- 4>&1 ) 4>&1`;
};
if ($?) { warn "myprogram failed: $?" }
The error:
syntax error at zz line 9, near "};"
Any ideas?
Thanks in Advance
Tom