if you're familiar with nmap then you might know that while it's running you can hit the enter key and it will return the status.
That is not always true. It depends on 3 factors 1) the system it's being run on, 2) the version of nmap and 3) the version of pcap.
What you want to do can't be done via the system function because it simply forks a child process and blocks the parent until the command completes and then returns the exit code to the parent. What you want to achieve might be possible via Expect, but I've never bothered to test it.
man expect -
http://linux.die.net/man/1/expect Expect.pm perl module -
http://search.cpan.org/~rgiersig/Expect-1.21/Expect.pod My recommendation would be to use the Nmap::Scanner module.
http://search.cpan.org/~maxschube/Nmap-Scanner-1.0/lib/Nmap/Scanner.pm