I would like to have my scripts keep track of thier last date of revision internally as a comment. Is this possible? It seems to me that it would need to grab the date and
The following worked on a FreeBSD system. It appends to the end, which sounds acceptable to you, but doesn't conform to the "normal" way of documenting changes within a file - at least for me, as I've almost always seen it done at the beginning. You'll probably want to change the way the date/time is displayed.
#!/usr/bin/perl -w
open SELF, ">> selfModify.pl" or die "Unable to open self";
print SELF "# ran/modified at " . join(' ', localtime()) . "\n";
close(SELF);
Whether this is wise or not I'll leave for you to decide.