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?


In reply to Re: Really need help with loop variable by demerphq
in thread Really need help with loop variable by cal

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.