I am guessing that sending STX and ETX is part of the protocol for this pro*c thing. This is definately not part of IO::socket. A socket is to be considered a stream of bytes (assuming TCP) and nothing more. My guess is that the STX/ETX are there to allow several files to be sent over a single socket connection. In http/1.0 eg each file is sent in a seperate connection so closing the connection signals EOF.
One thing you might have to worry about is any kind of escaping/stuffing required in case the file happens to contain ETX.