Prev: FAQ 3.26 Where can I learn about object-oriented Perl programming?
Next: FAQ 6.2 I'm having trouble matching over more than one line. What's wrong?
From: michael20545 on 9 Aug 2010 08:28 Thank you Martin, Willem, sln, Wolf for your replies, but I found that Inkscape does not work (at least on Windows) in multiple instances :( But your suggestions were useful for creating graphs with gnuplot (11 vs 27 seconds for creating 215 graphs). Here is the last version (thanks Wolf for suggestion to use Thread::Queue). use strict; use threads; use threads::shared; use Thread::Queue; my @files=<*.gp>; my $q=new Thread::Queue; $q->enqueue($_) for @files; my @threads; push @threads,threads->new(\&make_svg,$_) for 1..3; $_->join for @threads; sub make_svg { my $thrnum=$_[0]; while(my $file=$q->dequeue_nb) { print "$thrnum $file\n"; `gnuplot $file`; } } --- news://freenews.netfront.net/ - complaints: news(a)netfront.net --- |