# using param... use CGI; $q = new CGI; # If the param is just a number then it is # assumed to be an item number. You may want to # change that assumption for (grep(/^\d+$/, $q->param)) { # Do something with $q->param($_) }