use CGI; use My::QXcall; $cgi = CGI->new(); my(@terms) = $cgi->param('t'); # do stuff sanitize input data, etc. foreach (@terms) { $_ =~ s/(?:^\s)|(?:\s$)//o; # trims leading/trailing whitespace # [other stuff I should be doing would go here...] } # look up terms with dict print QXcall(qq{dict ${\ scalar join(' ', map { "'" . quotemeta($_) . "'" } @terms) }});