#!/bin/perl # Script hostscomm.pl # Pull out all comment lines in /etc/hosts, and put them in # another file called hosts.comments open (HOSTS, "hosts.comments"); while ($line = ) { if ($line =~ /^#/) { print Comms $line; } } close HOSTS; close Comms;