What do you mean by 'echo' in your context? How to fill one out by scripted logic? How to include the form html in the script? How to print the results obtained to standard out? How to show the same form twice?
CGI.pm offers a couple of ways to do this:
Vars
and Dump.
However, i don't think you will be able to use these 'straight out of the box' without some
customization. Dump outputs HTML, not plain text -- and Vars will return multivalued parameters
as a packed string. Then there is the problem of understanding user and file permissions --
you have to make sure that the web server has authorization to write a new file.