in reply to Is this system call hazardous for my computers health??

I realize this wasn't your question, but what jumped out at me is that
system("rm","-f","$tmp_dir","*")
isn't going to do what you think. Using the list form of system instructs Perl to avoid using the shell, and to fork and exec rm directly, with the specified arguments. Since it's the shell that is responsible for expanding the *, and you're not using the shell, the * is never expanded, and is passed to rm literally. You end up attempting to remove a single file named *.

I suspect that what you should have done was simply

system("rm", "-rf", $tmp_dir);
as I think someone else already pointed out.