You describe 3 cases: your original code, your posted test snippet (with ls), and the test snippet with ls replaced by exec. From your description, it's not clear to me which of the three are failing for you. The last two both work for me (at least if I set $domain to something).
Dave.
Comment on Re: Safe open() with taint mode not working?
My explanation may have been a little unclear but I do not see where you get the three different instances from.
Basically I am using the above code in a cgi script and the filehandle <LKUP> never has a value. When I run this from command line it executes as it should as I said in my first post but when I run it inside my cgi script and try to print this data to the web page the filehandle is null.
Ah I see. The thing to do is to add debugging warns everywhere
around that code (eg warn "in child, about to exec...\n", and see what makes it into the web server's error log. Also, you should check for open() returning an undef value, and you should check for exec failing - in both cases, printing out $! to STDERR.