sub log_ open my log log txt or print Alarma flock log LOCK_EX print l

1
2
3
4
5
6
7
8
sub log_ {
open my $log, '>>', 'log.txt' or print "Alarma!!!!\n";
flock $log, LOCK_EX;
print $log $_[0];
print $_[0];
flock $log, LOCK_UN;
close $log
}