Skip to content

Instantly share code, notes, and snippets.

@sago35
Last active October 15, 2015 11:02
Show Gist options
  • Save sago35/5b40d262c8ec64d7012e to your computer and use it in GitHub Desktop.
Save sago35/5b40d262c8ec64d7012e to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use utf8;
use Path::Tiny;
use Time::Moment;
my $no = shift // die;
my $t = Time::Moment->now;
#my $wfh = path("log.txt")->opena_utf8({locked => 0});
open my $wfh, ">>", "log.txt" or die $!;
printf "%s 1\n", $no;
printf $wfh "%s %s\n", $t->strftime("%Y/%m/%d %H:%M:%S"), $no;
printf "%s 2\n", $no;
#sleep ($t->millisecond % 5);
sleep 5;
printf "%s 3\n", $no;
printf $wfh "%s %s\n", $t->strftime("%Y/%m/%d %H:%M:%S"), $no;
printf "%s 4\n", $no;
close $wfh;
__END__
# Makefile
# gmake --jobs
all: A B C D E F
A:
perl -e "sleep 1"
perl append_test.pl A
B:
perl -e "sleep 2"
perl append_test.pl B
C:
perl append_test.pl C
D:
perl append_test.pl D
E:
perl append_test.pl E
F:
perl append_test.pl F
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment