in reply to text formatting in a file

Well, yes, of course. From the OSses point of view (and that's the point of view from Perl as well), a file is nothing more than a stream of bytes. "Formatting" is application dependent, but whatever formatting is being used, it remains a stream of bytes.

Perl allows you to write any stream of bytes to a file, so it can deal with any formatting as well. Of course, the trick lies in knowing how the formatting is encoded by your application. There might be modules out there to help you, depending which formatting you require. Search CPAN.

Abigail