in reply to IO::Socket TTL?

I suspect that the TTL is set by the operating system, and it is unlikely that any will allow you to easily modify, on a per-socket basis, the outgoing time-to-live on TCP packets.

It might also be helpful to perhaps explain what you're trying to achieve, as the TTL is used for two reasons I can think of: 1) prevent packets living indefinitely in the case of a routing loop, and 2) traceroute which deliberately sets low TTLs in order to trigger ICMP responses.

If it is a traceroute-like function you're trying to implement then perhaps Net::RawIP or Net::Packet::IPv4 are worth looking at.