http://www.perlmonks.org?node_id=748000

pileofrogs has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Monks!

Short Version:How do I create an End of File character?

Long VersionI'm sending some YAML over a socket and I'm trying to figure out the best way to delimit the end of the YAML stream. I'm thinking of setting $/ to EOF on the reading end and sending an EOF after my YAML stream from the sending end. But, I don't know how to generate an EOF to send. I think EOF has the integer value of -1, but there's probably a more elgant portable way to do it, rather than just hard-coding it.

Thanks!
--Pileofrogs

Update:Great responses everyone! ++ all round!