Jul. 23rd, 2012

sobrique: (Default)
This is perhaps in the wrong order, but to follow on from a couple of rambles lately - threading and perl.
How do you basically do this?
Here is an example:
Read more... )

OK, that's pretty simplistic I know - but the major way I've found threads useful is for what amount to embarrassingly parallel problems, like 'connect to 200 servers, and run the same commands on each of them'. You could quite easily replace that rather trivial 'sleep' subroutine, with one that does an ssh to a host, to run a command and capture the output. (And maybe process the results, before returning them)

Also note: Perl has had threads for a while, but the module doesn't necessarily contain all the functions you need - latest version as of 2012-07-23 is 1.86 which is available from CPAN. (http://search.cpan.org/~jdhedden/threads-1.86/lib/threads.pm)

More detail: http://perldoc.perl.org/threads.html

Profile

sobrique: (Default)
sobrique

December 2015

S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728 293031  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 17th, 2026 08:31 pm
Powered by Dreamwidth Studios