💾 Archived View for thfr.info › cgi-source › testcounter.cgi captured on 2023-09-08 at 16:11:27.

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

#!/usr/bin/perl
use strict;
use warnings;

use Path::Tiny;
use autodie;

my $gem_header = "20 text/gemini";

#my $dir = path("/var/gemini/thfr.info/cgi-bin");	# adjust path for chroot
my $dir = path(".");
my $file = $dir->child("testcount.txt");
my $content = $file->slurp_utf8();		# file assumed to only contain integer
chomp $content;
$content++;

my $file_handle = $file->openw_utf8();
$file_handle->print($content);
close $file_handle;

print "$gem_header\r\n";
print "This file has been viewed $content times";