I'ts more complicated, but more flexible. The reason I
first ended up doing it this way is I was porting a program
which talked to a serial device through a port server.
So, the only thing I had to do to port it was change the
program Expect.pm was talking to... from telnet to cu.
Of course, if you don't need the flexibility, your way
is probably more simple.