in reply to Multithreading for perl code

How big is your file? If you have enough memory in your computer then you can simply read the file into an array and then use 'nearest' method.
my @lines = <STDIN>; foreach my $pattern (@array1) { my $tf = Text::Fuzzy->new ($pattern); my $fuzzy = $tf->nearest( \@lines ); # find fuzzy scanning the arr +ay of lines print "$pattern\t$fuzzy\n"; }

Replies are listed 'Best First'.
Re^2: Multithreading for perl code
by Anonymous Monk on Apr 08, 2015 at 11:10 UTC

    Hi,

    I have tried your idea but there is no difference. The file is about 30 MB of text.

    Thanks

      Reading a 30Mb file one time instead of 500 times should be quicker. How about posting what you tried? Maybe there is something you missed in your implementation.