#! /usr/bin/perl # Copyright (c) 1997 Greg Bacon. All rights reserved. # This program is free software. You may distribute it and/or # modify it under the same terms as Perl itself. use strict; my $DOT_PLAN = "$ENV{HOME}/.plan"; sub create_dot_plan { unless (-p $DOT_PLAN) { unlink $DOT_PLAN; my $cmd = "mknod $DOT_PLAN p"; die "Failed $cmd: $?\n" if system $cmd; } } ## main create_dot_plan; my $fingerings = 0; while (1) { open PLAN, ">$DOT_PLAN" or die "Failed open >$DOT_PLAN: $!\n"; $fingerings++; my $s; my $m; my $h; my $timestr; ($s, $m, $h) = localtime time; $timestr = sprintf "%d:%02d:%02d", $h, $m, $s; my $fing_str = $fingerings == 1 ? "just once" : "$fingerings times"; print PLAN < EOFooter close PLAN or print PLAN "Failed close: $!\n"; sleep 1; }