in reply to Re: One More bit of Perl/Tk Confusion
in thread One More bit of Perl/Tk Confusion

$mpy_mpe[$b]is item $b in the array @mpy_mpe. In this case $mpy_mpe[0] = my $mpy_1 = $mw->Entry( -width => 5, -textvariable => \$mpy1 )->pack();\n$mpy_1 -> grid(-row=>3,-column=>1, -in => $table);\nmy $mpe_1 = $mw->Entry( -width => 5, -textvariable => \$mpe1 )->pack();\n$mpe_1 -> grid(-row=>3,-column=>2, -in => $table);\n

Now, I can generate all 250+ rows that I need, but I only want to show the first 5, 10 or whatever is in $LST of them.

Replies are listed 'Best First'.
Re^3: One More bit of Perl/Tk Confusion
by Anonymous Monk on Jan 27, 2011 at 21:17 UTC

    Why not keep a count of how many you've added, and stop adding when the count gets too big?

      Automatically?

      I certainly know how to do it straight to html - that's a no-brainer.

      foreach my $b (0 .. $LST){ print qq{my html or CGI formatted row here} or die 'unable to print'; }

      I'm trying to emulate the same function in Tk. I don't know how many rows the final user is going to need. And once it's handed over, the person using it will not be in a position to edit it.