my($line, @line); while() { $line=$_; chomp($line); @line = split(/\./,$line); foreach(@line){ print OUT "$_\n"; } }