param() returns the names of all the parameters when called with any arguments. See the CGI docs.use strict; foreach ($query->param) { do_stuff($_) if /^c\d+$/; } sub do_stuff() { my $cd = shift; my $value = $query->param($cd); # blah }
Originally posted as a Categorized Answer.
In reply to Re: How do I pass a sequence of variable names to a subroutine one at a time?
by ar0n
in thread How do I pass a sequence of variable names to a subroutine one at a time?
by guzz1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |