bad programming? Security does not need to be an issue because the content is not important
Security is always important.
For a textbox all you need to do is print out the HTML for it.
[size=2]print q`<input type="text" name="[i]name[/i]">`;[/size]
while replacing the value of name to your own descriptive name (I don't know what you plan on using this field for).
To add the URL to the email you just need to add whatever URL you want to send in the same way all the other lines are printed in the Send_Email subroutine.
[size=2]print MAIL "Page link: $the_url_you_want_to_send\n";[/size]
To send an attachment you should use the MIME::Lite module and follow the instructions in their documentation.