my $filename = <userpass.txt>;
my $lines = 1;
my $buffer = 0;
open(FILE, $filename) or die "Can't open `$filename': $!";
while (sysread FILE, $buffer, 4096) {
$lines += ($buffer =~ tr/\n//);
}
close FILE;
my $txtnum = $lines;
$txtnum /= 2;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
$year += 1900;
$mon += 1;
my $days = Days_in_Month($year,$mon);
$days -= $mday;
$days += 1;
$txtnum /= $days;
my $rounded = sprintf("%d", $txtnum);
open(F, '>:utf8', '1.txt');
print F "$rounded";
close F;