What error messages have you got, in Tomcat error log?
We should avoid using external commands in Perl as much as possible, for example, to delete a file, you can simply use 'unlink'.
I presume you are using ActivePerl, which contains loads of Win32 functions with which you can bypass system calls.