in reply to License key for script

I would go one step further and actually delete the script if it is run past its period of validity:
use Acme::Scripticide qw(good_bye_cruel_world); if( subscription_is_expired() ){ good_bye_cruel_world('This script is now no more!'); exit; }
Testing it is actually a bit difficult! I once lost my 5 line script proving Fermat's last theorem that way.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: License key for script
by JavaFan (Canon) on Sep 04, 2010 at 08:49 UTC
    I once lost my 5 line script proving Fermat's last theorem that way.
    That's ok, there was a bug in line 3 anyway.
Re^2: License key for script
by pemungkah (Priest) on Sep 07, 2010 at 06:32 UTC
    A script which stops and says
    "You have not paid your monthly subscription fee agreed to when you li +censed this software. Please visit htttp://yoursite.com/payme.html and submit your license f +ee to receive a new run key. You will need your license number, which is XXXX-XXXX-XXXX-XXXX. Thank you. This program will no longer run until the subscription is p +aid"
    makes it clear that YOU NEEDA PAY YOUR BILL, BUCKO and no damage is done, except perhaps to the ego of the person who didn't pay the bill.

    A self-deleting program could be stretched by a sympathetic DA into being a "logic bomb" and therefore prosecuted as illegal - even if it was your right to disable access to the program. This is not a chance to take. Also, you might get sued for loss of income, etc. by the licensee (even if he's in the wrong!) because he had to spend X hours at $LARGENUM per hour making sure your program hadn't damaged your system. Also not a chance to take.

    As mentioned, the only real way to be sure that your client isn't cheating is to host the software somewhere you control and block access if the bills aren't paid. Just hosting the license check won't do, especially in Perl, since the the license check can be removed without damaging the rest of the code.