in reply to Confusing Syntax

You also forgot use strict; and use warnings; at the top.

BTW, you could simplify some of those long similar lists by looping over 1..14:

my %pics = (pic0 => $q->param("photo")); $pics{"pic$_"} = $q->param("photo$_") for 1..14; my @pic_filehandles = map { $q->upload("photo$_") } '',1..14;

(It would get even simpler if you used "photo0" for your first name.)