To get your code to work you need something like this:

use strict; my $total_elements = 8; my $NEW_BUS_TXT; my $NEW_BUS_TXT1 = 123; my $NEW_BUS_TXT2 = 123; my $NEW_BUS_TXT3 = 123; my $NEW_BUS_TXT4 = 123; my $NEW_BUS_TXT5 = 123; my $NEW_BUS_TXT6 = 123; my $NEW_BUS_TXT7 = 123; my $NEW_BUS_TXT8 = 123; my $NEW_BUS_TXT9 = 123; my $NEW_PD1 = 123; my $NEW_PD2 = 234; my $NEW_PD3 = 345; my $NEW_PD4 = 456; my $NEW_PD5 = 567; my $NEW_PD6 = 678; my $NEW_PD7 = 789; my $NEW_PD8 = 890; my $NEW_PD9 = 901; my $varname = ''; for (my $x=1; $x <= $total_elements +1; $x++) { $varname .= "fname_menu$x"; $NEW_BUS_TXT = eval "\$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>" +. eval "\$NEW_PD$x". "\n"; } print $varname;

To get your code to actually do something useful will take longer. How about you let us know a little about what you want to do here.

This page is intentionally left justified.


In reply to Re: Really need help with loop variable by Caillte
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.