#!/usr/bin/perl -w #test.pl use strict; use local::lib; use LWP::Simple; use Cwd; use Parallel::ForkManager; my @timenow = localtime; my @files = (1 ..100); my $fork = new Parallel::ForkManager(8); foreach my $file (@files){ $fork->start and next; open (my $out, ">>", "output_newfh_" . $timenow[1] . "_" . $timenow[0] . ".txt") || die "Could not open output: $!\n"; my $checksum = "md5sum $file"; print $out "Analysis for file $file\n\tchecksum $checksum\n"; close $out; $fork->finish; } $fork->wait_all_children;