#!/usr/bin/perl #################################################### # # # V 2.0 1999-04-09 Håkan Edman # # The use of a temp file to speed things up. # # # #################################################### &Check(); # # Subs down here. # sub Check { $nu = `/bin/date +%Y%m%w%H%M`; chomp $nu; $last = `cat ./senaste`; chomp $last; $diff = $nu - $last; if ($diff <= 15){ open(PAGE,"./senast.html") || die "Couldn't open senast.html"; while ( ) { print; } close(PAGE); exit 0; } &Byggsida(); open(STAMP,">./senaste") || die "Couldn't open the timestamp file."; print STAMP "$nu"; close(STAMP); } sub Byggsida { @bilder=`ls *.jpg`; print < Arco-98 EOD $h=0; foreach $n (@bilder) { $h=$h+1; $e=$h%5; @m=split(" ",$n); print " \n"; if ($e == 0) { print "\n\n\n"; } } print <
Tillbaka

Foton av KLAAN . © 1999 Kod av Håkan.
EOD # # Time to write to disk. # open (BYGG,">./senast.html") || die "Couldn't open senast.html."; select (BYGG); print < Arco-98 EOD $h=0; foreach $n (@bilder) { $h=$h+1; $e=$h%5; @m=split(" ",$n); print " \n"; if ($e == 0) { print "\n\n\n"; } } print <
Tillbaka

Foton av KLAAN . © 1999 Kod av Håkan.
EOD }