Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

scrottie (4167)


My email address is Spam me harder! *moan*

Journal of scrottie (4167)

Friday May 18, 2007
09:27 PM

Self-reloading Continuity daemons

[ #33309 ]
  async {
    my $timer = Coro::Event->timer( interval => 2, );
    my $mod_time = -M __FILE__;
    while(1) {
        if(-M __FILE__ != $mod_time) {
            $mod_time = -M __FILE__;
            Storable::nstore { board => $board, players => $players, }, "$";
            STDERR->print("Exec-ing self!\n\n");
            exec '/usr/bin/perl', __FILE__ or warn $!;

On startup, it initializes its two main objects from the .store file.

Saving from vi causes it to immediately reload itself.


The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.