Acme::Scripticide - Perl extension to allow your script to kill itself
auto call good_bye_cruel_world()
use Acme::Scripticide;
auto call good_bye_cruel_world('Good bye cruel world')
use Acme::Scripticide qw(Good bye cruel world);
auto put "Good bye cruel world" in [$0 w/out \.\w+$].html, call good_bye_cruel_world()
use Acme::Scripticide ('.html', qw(Good bye cruel world));
only do it when and where you want
use Acme::Scripticide qw(good_bye_cruel_world); if(i_take_medication_and_therapy()) { print "Take that Tom Cruise, you wacky weirdo, tell Jackson howdy."; } else { good_bye_cruel_world(); }
None by default.
You can export good_bye_cruel_world and then it won't be automatically done, only when you call it.
This will make your script not exist once its done:
good_bye_cruel_world()
This will replace your script with $note:
good_bye_cruel_world($note)
This will make your script not exist once its done and put $note in [$0 w/out .\w+].ext
good_bye_cruel_world('.ext', $note)
Beleive it or not this is handy if you have a one time job to execute:
# $script uses Acme::Scripticide system $script if -e $script;
or say to create static files from a database:
# in flowers.pl (copy this to whatever names you want and execute:) use Acme::Scripticide qw(good_bye_cruel_world); good_bye_cruel_world('.html', get_html($0));
now flowers.pl does not exist and flowers.html is there
You could have a directory full of those types of scripts and glob() them in and execute each one, once done you have a directory of corresponding static html files...
Use at your own risk, this deletes your script so you've been warned :)
Only kill your scripts. If you feel like hurting yourself, please seek professional help.
In the interest of not being too morbid I refrained from making aliases to the function with more graphic names.
Daniel Muey, http://drmuey.com/cpan_contact.pl
Copyright 2005 by Daniel Muey
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Acme::Scripticide, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Acme::Scripticide
CPAN shell
perl -MCPAN -e shell install Acme::Scripticide
For more information on module installation, please visit the detailed CPAN module installation guide.