Our Sponsors



Download BioinformaticsOnline(BOL) Apps in your chrome browser.

Freelancer

AdvertiseWithUs

Collision free write with Perl

  • Public
By Jit 9 days ago
#Write into outfile -- collision free because of multicore usesage sub collision_free_write { my($outFile, $msg) = @_; open my $ofh, ">>", $outFile or die "$0 [$$]: open: $!"; flock $ofh, LOCK_EX or die "$0 [$$]: flock: $!"; print $ofh "$msg\n" or die "$0 [$$]: write: $!"; close $ofh or warn "$0 [$$]: close: $!"; }