commit - 1f1dc31d2ab8e43114689286014bbe8643c7cc91
commit + 0c4b2feaac7334c0ef11355e6871b0396579ed07
blob - af1bae59f74297fdd1b70187b06f561e5c000f61
blob + 593d7626fde38c45f380c5ebda7690fe4b17e0cf
--- botnow
+++ botnow
use OpenBSD::Pledge;
use OpenBSD::Unveil;
use File::Copy qw(copy);
+use File::Basename;
# Returns date in YYYYMMDD format
sub date {
sub writefile {
my ($filename, $str) = @_;
my $date = date();
- copy($filename, $filename.date()) or die "Could not make backup of $filename";
+ copy($filename, basename($filename).date()) or die "Could not make backup of $filename";
open(my $fh, '>', "$filename") or die "Could not write to $filename";
print $fh $str;
close $fh;