A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Simple Perl parallelisation


@waitlist = (10,20,16,12,8,22);

foreach $item (@waitlist) {
pipe *{$item},RETHAND;
unless ($pid = fork()) {
# Child process
sleep $item;
print RETHAND "Completed $item\n";
exit();
}
}

foreach $item (@waitlist) {
$response = <$item>;
$now = localtime();
print "$now - $response";
}


Replace sleep with a more useful command.