# prompts the user for a filename, then logs all input lines
# to that file, until a line consisting only of "." is seen.
print "What is the name of the keylogging data file? ";
my $file = <>;
chomp $file;
open LOG, "> $file" or die "error writing $file - $!";
while ( $line = <> and $line ne ".\n" )
{
print LOG $line;
}
close LOG;