#!/usr/bin/perl use strict; use warnings; package Touchable; exit 0 unless (stat ($0))[9] && (($^T - (stat ($0))[9] ) < 3);
# consuming script: yourprogram.pl use strict; use warnings; use Touchable; print "here $0\n"; # usage example perl yourprogram.pl # works only if touch activated.. touch yourprogram.pl & perl yourprogram.pl here yourprogram.pl
Have fun!
L*
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Activate your perl programs by touch with Touchable.pm!
by ww (Archbishop) on Apr 01, 2016 at 10:21 UTC | |
|
Re: Activate your perl programs by touch with Touchable.pm!
by FreeBeerReekingMonk (Deacon) on Apr 01, 2016 at 19:32 UTC |