Because I don't know how to do it. How can a piece of code understand if there already exists a connection to an external program so that it can re-use it without opening a new one thus saving time?
our $ALREADY_CONNECTED = 0; # this var's purpose is called a semaphore
DOCUMENT:
for my $document (@collection) {
if (!$ALREADY_CONNECTED) {
open2(...); # and save the handles for later usage
$ALREADY_CONNECTED = 1; # whoa! magic!
redo DOCUMENT;
} else {
# blah blah process $document here,
# the in/out handles exist.
};
};