Thanks for the links, i read some stuff in them and made my own script

However, im a complete newbie when it comes to programming/scripting in any language, so i kinda need some help with what ive done!
#!/usr/bin/perl
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Nmap::Parser;
# Variables
###########################
my $q = new CGI;
my $path = '/usr/bin/nmap';
my $args = '-sP';
my @ips = qw/192.168.1.*/;
# Scan the network for active IPs and do html stuff :/
######################################################
print "Content-Type: text/html\n\n";
print "<html><head><title>IPs in use: LAN</title></head>\n";
print "<body>\n";
my $nmap = new Nmap::Parser;
$nmap->parsescan($path, $args, @ips);
print "
<style type=text/css>
body {
font-family: helvetica, verdana, arial, sans-serif;
}
TABLE {
border-collapse: collapse;
border-spacing: 1;
border-width: 1;
border-color: rgb(180, 180, 200);
background-color: rgb(245, 245, 245);
font-family: helvetica, verdana, arial, sans-serif;
font-size: 80%;
font-weight: normal;
margin-top: 1ex;
margin-bottom: 1ex;
}
TH {
background-color: rgb(25, 42, 165);
color: rgb(250, 252, 255);
padding: 0.4ex 1ex;
text-align: left;
vertical-align: top;
}
TD {
background-color: inherit;
/*color: rgb(245, 249, 255);*/
padding: 0.4ex 1ex;
vertical-align: top;
}
</style>";
print "<h2>IP addresses that are in use</h2>
<p> This script scans the lan for active IP addresses.</p>";
print "<table width=500 border=1><tr><th width=150>Hostname</th> <th align=right width=100>IP address</th> <th>MAC address</th></tr></table>";
for my $host ($nmap->all_hosts(up)) {
$hostn = $host->hostname;
$ip_addr = $host->addr;
$mac_addr = $host->mac_addr;
# $vendor = $host->mac_vendor;
print "<table width=500 border=1><tr> <td width=150>$hostn</td> <td align=left width=100>$ip_addr</td> <td>$mac_addr</td></tr></table> \n";
}
print "</body>";
print "</html>\n";Does anyone know how i can get a pretty output? (theres a white space between every IP now, dunno why

)
Oh.. and how come MAC addresses only show when i run my script in the terminal and not when i run it in the webserver (the webserver is on the same box as i host as a gateway/router)?
EDIT::
The MAC addresses only show if root runs the script, anyone know why? or possible fixes to this?
// Thanks, boney