OK guys, thanks for the pointers, seems I haven't understood list v scalar context as well as I thought - guess I'll have to re-read that bit in "Learning Perl".
Also may have confused myself unnecessarily by using the same variable name in different places.
Will look up the CGI module - I'm very unfamiliar with what modules are available.
I was also planning on using Mail::Sendmail for the next part of the script.