in reply to How can i change the file extension?

To change the file extension is easy, either renaming or i.e:

use File::Copy; copy("text.txt","text.html")

But note that this is not the same as to change the type of file.

So you probably want instead to convert your files to html files, and this is a different problem. Take a look to the module TextToHTML

If you use GNU the file extension is not really relevant, you could have a jpg named file.txt or file.pdf and will be perfectly recognised as image