in reply to How do I pass a sequence of variable names to a subroutine one at a time?

(The following is the answer to what I understand your question to be :)

How about:
use strict; foreach ($query->param) { get_cand_info($_) if /^c\d+$/; } sub get_cand_info() { my $cd = shift; my $value = $query->param($cd); # blah }
param() returns the names of all the parameters when called without any arguments. See the CGI docs.

update

Since nobody seems to bring it up,
$pq_out = `/opt/bin/pq -o '%last:%first:%loc:%room:%tel:%id' hrid=$c1` +;
is rather unsafe. Read perlsec!


[ar0n]