NAME

Thorium::Utils - additional utilities

VERSION

version 0.509

SYNOPSIS

use Thorium::Utils;

Thorium::Utils::block_new_invocations();

...

END {
    Thorium::Utils::unblock_new_invocations();
}

SUBROUTINES/METHODS

block_new_invocations([$filename])

Creates a file lock on a temporary file, or you may pass in your own file name. The lock file handle is global and should not be tampered with outside the library interface.

unblock_new_invocations()

Release the lock on the temporary file.

page($text)

Pipe $text through a pager.

already_running($filename, $executable)

Returns 1 if the process ID listed in $filename and $executable are currently running, 0 otherwise.

halt($pid)

Sends SIGTERM to $pid and waits up to 8 seconds for it be terminated.

run(@command)

Executes @command and blocks until it finishes. Returns a true value if successful, false otherwise.

execute(@command)

fork()s @command and exec()s.

AUTHOR

Adam Flott <adam@npjh.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Adam Flott <adam@npjh.com>, CIDC.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.