Skip to content

Instantly share code, notes, and snippets.

@toritori0318
Created June 4, 2011 16:13
Show Gist options
  • Select an option

  • Save toritori0318/1008024 to your computer and use it in GitHub Desktop.

Select an option

Save toritori0318/1008024 to your computer and use it in GitHub Desktop.
現在日付の実働日をチェック
#!/usr/bin/env perl
use strict;
use lib;
use Time::Piece;
use Calendar::Japanese::Business;
my $c = Calendar::Japanese::Business->new;
use Getopt::Long qw/GetOptions :config auto_help/;
my $work_day;
GetOptions(
'work_day|d=s' => \$work_day,
);
exit -1 unless $work_day;
my $current_workday = $c->get_workday_from_day(localtime->mday);
if($work_day == $current_workday) {
exit 0;
}
exit -1;
__END__
=head1 SYNOPSIS
check_workday.pl [options]
Options:
--help display help message
--work_day(d) check work day
=cut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment