Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matsumotory/perl-supporter
Perl module supporting code.
https://github.com/matsumotory/perl-supporter
Last synced: about 2 months ago
JSON representation
Perl module supporting code.
- Host: GitHub
- URL: https://github.com/matsumotory/perl-supporter
- Owner: matsumotory
- Created: 2012-07-19T16:00:39.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-07-19T16:04:54.000Z (over 12 years ago)
- Last Synced: 2024-10-18T18:21:10.649Z (3 months ago)
- Size: 93.8 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Sample Code
* Coding Perl Support Module - Supporter```perl
#!/usr/bin/perl
#############################################################################################
#
# Sample Script Using My Perl Module
# Copyright (C) 2012 MATSUMOTO, Ryosuke
#
# This Code was written by matsumoto_r in 2012/07/13 -
#
#############################################################################################
#
# Change Log
#
# 2012/07/14 matsumoto_r first release
#
#############################################################################################
use strict;
use warnings;
use File::Spec;
use File::Basename;
use Cwd;
use lib "./lib";
use Supporter;
our $VERSION = '0.01';
our $SCRIPT = basename($0);
our $CDIR = Cwd::getcwd;
our $SUPPORTER = Supporter->new(
debug => 0,
info => 1,
warn => 1,
error => 1,
tool_name => "$SCRIPT-$VERSION",
syslog_type => "$SCRIPT-$VERSION",
log_file => File::Spec->catfile($CDIR, "$SCRIPT-$VERSION.log"),
pid_file => File::Spec->catfile($CDIR, "$SCRIPT-$VERSION.pid"),
lock_file => File::Spec->catfile($CDIR, "$SCRIPT-$VERSION.lock"),
);
$SIG{INT} = sub { $SUPPORTER->TASK_SIGINT };
$SIG{TERM} = sub { $SUPPORTER->TASK_SIGTERM };
$SUPPORTER->info_record(__PACKAGE__." $SCRIPT($VERSION) start");
$SUPPORTER->info_record(__PACKAGE__." $SCRIPT locked");
$SUPPORTER->set_lock;
$SUPPORTER->make_pid_file;
# write code
$SUPPORTER->info_record(__PACKAGE__." $SCRIPT($VERSION) end");
exit 0;
```