my $flck = 1; #or 0 sub lock{     local *FH = shift;     my $mode = shift;     flock(FH, $mode) if($flck); }