in reply to Add Perl Varibles in system()
system('nmap', $target); [download]
Using the this method, the shell will be bypassed so you don't have to worry about converting the value of $target into a shell literal.