#!/usr/sbin/perl -w use strict; #... while ($file = <*.dem>) { open(FILE, "$file") || warn "Warning: can't open $file, skipping.\n"; ($outfile, $right) = split(/\./, $file, 2); open(FILEOUT, ">$outfile.xyz") || die "\nERROR: Can't open $outfile, exiting.\n"; while () { chomp; #...