Just work through one change at a time from the working script to the failing one.
If it works with
-values=>['eenie','meenie','minie','moe'],
try it with
use CGI qw/:standard/;
my @words = ('eenie','meenie','minie','moe');
print
.
.
-values=>[@words],