You shouln't use one-argument form of
system in such unsafe way (imagine somebody running in that directory:
touch file \;\ -rf\ \* and thus creating a file named
file; rm -rf *). Use
quotemeta to quote special characters or use
IPC::Run and pass arguments and file redirections as list elements.
Sorry if my advice was wrong.