<quote>Thinking about it, how are the two outputs (two DB9 com ports) represented on the one chip?</quote>
It's an object, so it can keep the "previously selected output" in the internal state of the object.
So, you do a OpenBySerial or OpenByIndex, and the calls to methods like SetBitMode operate on the port that was last opened.
The docs for the perl module seem wrong with respect to SetBitMode. It wants a mask and mode. Within the source code are some constants for the mode:
# Get/Set BitMode
use constant PFT_BITMODE_RESET => 0x00;
use constant PFT_BITMODE_ASYNCBB => 0x01;
use constant PFT_BITMODE_MPSSE => 0x02;
use constant PFT_BITMODE_SYNCBB => 0x04;
use constant PFT_BITMODE_MHBEM => 0x08;
use constant PFT_BITMODE_FOISM => 0x10;
use constant PFT_BITMODE_CBUSBB => 0x20;
The mask is telling it which pins are input and which are output. A 0 bit is an input, a 1 is an output. The lowest bit is D0 (TXD), next is D1 (RXD), and so forth. Google "FTDI2XX mask mode bitbang" and you'll find the whole mapping.
So, to set all lines/outputs to output in async bitbang:
# assuming you called OpenByIndex on this object already
$mode = $FTDIdev->SetBitMode(0xFF, 0x01);