Merge Graphics with text file

I would like to insert a graphic image like .jpg, .gif file in a text doc generated through an application (PERL) in UNIX environment.

Could any one help me ?

Thanks much

What document format is generated?

The format of the output file is just plain text

The output format will have to change.

Please let me know all the different options available to me. I can change the output format. It is not an issue

If the output format can be Postscript/PDF, you can try to generate LaTeX sources through scripting, and then pass the output to LaTeX to convert into PS/PDF. In the university that I studied in, I know of one department which creates shell accounts with random passwords and issues corresponding password sheets in this way. A text-based doc with an image logo. The pdflatex program understands .png and .jpg natively.

If LaTeX appears too hardcore, docbook can be an alternative, though that is not straightforward either.

Thanks for the input. It helps me a lot