💾 Archived View for thfr.info › cgi-source › testcounter.cgi captured on 2024-03-21 at 15:19:02.

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";