Check out Win32::SerialPort if on Windows, and Device::SerialPort if on Linux. It doesn't do the modem commands for you, but I'm pretty sure it allows you to send them yourself to an attached modem. The demo code that comes with the latter seems like a nice starting point, to me.