foreach $i(@input) { #create assoc. array to hold forms variables ($name, $val) = split (/=/, $i); if ( length($val) > 80 ) { &error( "Form input variable $name longer than 80 characters; exiting."); return; } #remove all potentially unsafe characters $val =~ tr/ /_/; #no spaces $val =~ tr/+/_/; #no pluses $val =~ s/[^a-zA-Z0-9_.,@-]//g; #anything but these strip #reassign val to goodval to be extra safe $goodval = $val; if ( $goodval ) { $value{$name} = $goodval; # Values{} holds multiple values- HashOfArrays push (@{ $Values{$name} }, $goodval); # } }