open CFGFILE, "< ship.cfg" or die "read ship.cfg: $!"; while () { /#/ and next; /^([\w.]+)$/ or next; push @hosts, $1; } close CFGFILE;