Just a thought. How about changing the ok(system()) to is(system(), 1) to see what the system call
is actually returning? It could conceivably be as maddening as to return the success of your redirecting the output.
Sometimes I can think of 6 impossible LDAP attributes before breakfast.