Problem executing setuid script in perl-5.8.6

Hi,

I have a script (a.pl) that can be run by anyone. The script internally has to read a file and write into few files which are owned by user 'myUser'.

Has to read the following file:
-rwx------ 1 myuser myuser 4986 Aug 20 18:11 my.file
Has to write into following files:

-rw-rw-r-- 1 myuser myuser 2187 Aug 21 15:11 a.log
-rw-rw-r-- 1 myuser myuser 0 Aug 20 17:53 b.log
-rw-rw-r-- 1 myuser myuser 4933 Aug 20 17:57 v.log

So, I have made a.pl as setuid script. It used to work fine in perl-5.6.1
In perl-5.8.6, it started to throw the following famous fatal error
"Insecure dependency at system ...." where i use system() to execute a java class.

system "/usr/local/java/jdk1.5/bin/java", "mypackage.mysubpackage.MyClass";

Could somebody help me out either by suggesting a different approach to accomplish the above task or mentioning a workaround for executing setuid scripts in perl-5.8.6?

thanks in advance,
Sarma.