
$STATIONS = `cat STATIONS`;
unless ($STATIONS =~ /.+/) {
  print "Workstations missing.\n";
  exit 1;
}
@STATIONS = split(/\n+/,$STATIONS);

foreach (@STATIONS) {
  s/^\s+//;
  s/\s+$//;
  if ($_ !~ /^\S+\s*\d*$/) {
    print<<END;
"$_" formatted incorrectly.
Format is:
            machine.domain [positiveInteger]
END
    exit 1;
  } 
  if ($_) {
    $LIST .= "$_\n"; 
  }
}

open (HANDLE, ">STATIONS");
print HANDLE $LIST;
close (HANDLE);
