This cretainly cleans up the logic. Tidy! But the resulting behavior is unchanged. No output from system(). I added an else to confirm that all went well in case of return of 0. No print out there either. Script runs and no reports!
Permissions are everywhere wide open and Kreports.plx runs from command line on cgi-bin or at home.