From cliffo@u.washington.edu Sun Mar 12 17:58:47 2000 Received: from jason01.u.washington.edu (root@jason01.u.washington.edu [140.142.70.24]) by lists.u.washington.edu (8.9.3+UW99.09/8.9.3+UW99.09) with ESMTP id RAA46982 for ; Sun, 12 Mar 2000 17:58:46 -0800 Received: from dante40.u.washington.edu (cliffo@dante40.u.washington.edu [140.142.15.200]) by jason01.u.washington.edu (8.9.3+UW99.09/8.9.3+UW00.01) with ESMTP id RAA33172 for ; Sun, 12 Mar 2000 17:58:45 -0800 Received: from localhost (cliffo@localhost) by dante40.u.washington.edu (8.9.3+UW99.09/8.9.3+UW99.09) with ESMTP id RAA83466 for ; Sun, 12 Mar 2000 17:58:45 -0800 Date: Sun, 12 Mar 2000 17:58:45 -0800 (PST) From: "C. Olmsted" To: UW Linux Group Subject: Re: perl q's In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Thanks, I just figured it out I think. The solution is to do something like this... # test solution $i = 1; $temp1 = "blah"; print `temp$i`; exit ; Note the apostrophe. Let me know if anyone has better/alternative solutions. Cliff On Sun, 12 Mar 2000, C. Olmsted wrote: > Hey all, > > Yet another non-linux question :) I'm working on a cgi development for > work. I have a list of input variables on an html form set up like this: > > name1, name2, name3, name4,... > > I would like to create a loop to parse each of the names in turn since > there could be any arbitrary number of these variables with > different values for each (the form is dynamic). > > My thinking is something like this... > > for ($i = 1; $i <= $count; $i++) > { > $name$i = param('$name$i') > print $name$i; > } > > where $count is the number of names that exist in the list. > > Of course this doesn't work since I don't know how to combine > two variables into one variable name. Is a foreach loop what I really > want to use? > > Thanks, > Cliff > > > .