#! /usr/bin/perl

use locale;
use encoding "utf8";

binmode STDOUT, ":utf8";

while ($file = shift @ARGV) {

	open(FILE, $file) or next;
	binmode FILE, ":utf8";

	while ($line = <FILE>) {

		chomp($line);
		$line =~ s/\W/ /g;

		@words = split(/\s+/, $line);

		for $word (@words) {
			print "$word\n";
		}
	}
	
	close(FILE);
}
