in reply to fetch url

You want to:
Fetch an url. (Or so you say)
use LWP::Simple
Read a CSV file.
It's not as easy as you think. use Text::xSV
Render dynamic HTML
If your script gets more complicated you might want to try a templating module. there are loads of them on CPAN

Generic notes: I think in this case

next unless $_;
is much neater than
next if 0 == length($_);
but if you need that line, you're not reading CSV anyway.

I really have no idea what you mean with "must it be i a form"? There is no form.

As for "Must I use the "my $query = new CGI;" codes" - well, if you're going to parse input, yes. Also, if you use the CGI modules methods $query->request_uri and $query->referer(), that'll trap misspellings of the %ENV entries.