defined $statfile && open my $FILE, ">", 'last_5min.stat' or die $!; <...> defined $statfile && print $FILE "$by\nMax Busy\n";