in reply to using Parallel::TaskManager and FileHandles.

See Those fork()ing flock()ers... for some information on this very issue.

Also, may I suggest the following change:

my @custom = ( qr /postmaster/ , qr /webmaster/ ); ... foreach $x (@custom){ if ($add =~ $x ){ $FH = "BADADDR"; writeaddr(); #address is bad $pm->finish; } }

By compiling your regular expressions only once before you fork, you may save some time. Especially if you have a very long list of e-mails.