in reply to Add Perl Varibles in system()

If $target is an entire argument, the best method would be to use the multi-argument form of system.
system('nmap', $target);

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.