in reply to Re^3: segmentation fault
in thread segmentation fault
In what sense is open( ... ) or die "..." not sufficient for you? (The same works for "close", but in a unix/linux environment, it's unlikely closing a file handle will ever be a problem -- I gather it can be an issue on mswindows.)
If there are still problems with running the sub-process from within the script, you should print the command line to STDERR before trying to execute it, so you can see what the sub-shell is being given, and then try running that manually to see what happens. Given that the segfaults are intermittent, they are caused either by the data being used to build the command line, or else by other conditions on your machine that are external to your perl script. (If the script starts multiple sub-processes within a single run, there's also a possibility of interference or confusion among sub-processes.)
|
|---|