Hi all, 

One day I am going to stop asking these fairly dumb questions, and start
answering them with a wise and profound look on my face, but in the
meantime...

I know this one has to be pretty simple, but I can't work out how to do it,
and I haven't been able to find anyone else doing it.  

I am receiving a lot of values from a form.  I want to loop through them and
set new variables, with the same name, to the same value.  EG:  I want the
param value phone to be set to $phone.

I know I could do this with hardcoding by my $phone =
$query->param('phone'), but this seems to me to be a bit of a waste of
typing when I already have a foreach loop happening.  (I know, I know,
laziness is bad).  This is my foreach loop:


$query = new CGI;
@values = $query->param;
foreach $item (@values) {
print $item ."=". $query->param($item)."<br>";
$msg .= $item ."=" . $query->param($item) . "\n";
}



I've tried \$.$item =  and I've tried "$".$item = and I've tried eval($item)
=

I'm sure there must be an easy way to do it.  As I said, I know I don't HAVE
to do it, and I could just use $query->param('whatever') whenever I need it,
but it's annoying me now, and I want to know.

Sorry if it's too stupid a question, and you all go "Tchah, moron!" at me
(please feel free to, as long as you also let me know exactly WHY I'm a
moron, 'cause as I said, it's annoying me).

Cheers

di

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to