in reply to Really need help with loop variable

Hi cal.

Sorry to do this to you but...

<Lecture>

</Lecture>

So now lets look at your code:

for ($x=1; $x <= $total_elements +1; $x++) {$varname = "fname_menu$x";$NEW_BUS_TXT = ${"NEW_BUS_TXT$x"}; $$varname = " <table border='1' width='100%' bgcolor='#BBEEEE'> <tr> <td width='100%'> <B>($x.)Using the pull down menu Select a member</B> ${NEW_PD$x} }
Hmm.. first thing I see (beyond the above serious issues :-)is that your code is messy and confusing, so Ill clean it up a bit.. But I cant. Because there is no trailing " to finish your quoted section. So Ill make some dangerous assumptions about your code and show you what this could would look like (if I used symbolic refs that is)
for my $x (1..$total_elements+1) { $varname = "fname_menu$x"; $NEW_BUS_TXT = ${"NEW_BUS_TXT$x"}; $$varname = <<"EOF_HTML"; <table border='1' width='100%' bgcolor='#BBEEEE'> <tr> <td width='100%'> <B>($x.)Using the pull down menu Select a member</B> ${NEW_PD$x} EOF_HTML }
This stuff is scary... Sorry, but it's true.

What I think you are doing is trying to do is build a numbered set of tables, but the problem is where is the end of the table/row/cell? Is it in the mysterious symbolic reference ${NEW_PD$x}? And what is this for:$NEW_BUS_TXT = ${"NEW_BUS_TXT$x"};

So to be honest there isnt a lot that I (or IMO anyone else here) can do with this code.

OTOH: I can give you some more tips.

Anyway, hope this is a bit of help at least. And please dont give up. Leave that use strict; right at the top of every script, exactly where it belongs. Fight and fight until all those nasty errors go away, in the end youll be happy you did (not to mention being a far better programmer).

Yves / DeMerphq
--
When to use Prototypes?