Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3313504
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:07:23+00:00 2026-05-17T22:07:23+00:00

use POSIX; my $test = ; my $elements = scalar(@array); my $tablecount = ($elements

  • 0
use POSIX;
my $test = "";
my $elements = scalar(@array);
my $tablecount = ($elements / 100);
my $tblnum = ceil($tablecount);
my @hundred;
 foreach $test (@array) {
   until ($tblcnt == $tblnum){
   @hundred(@array, 0, 99);
   print qq~<table id="$tblcnt"><tr><td>~;
     foreach $test (@hundred){
     print qq~<tr><td>$test</td></tr>~;
     }
   print qq~</table>~;
   $tblcnt++;
   }
}

UG!!! I am trying to learn this but, I just cannot get it right!!!

I am trying to dynamically generate “x” number of html tables filled with up to 100 lines of data each.

I can get the table count needed, I can loop, I can add but, one thing is for sure: I CANNOT WRITE CODE.

Here is the result wanted:

1- I have 1027 lines of data from an array.

2- I want my script to make 11 html tables with up to 100 lines each. ((Layers actually) which by default will be not visible via css. That way I can do some show hide on the tables like a “next prev” navigation. I don’t need help with the cross browser css.)

3- IF there is a better way, a method that I can comprehend anyhow, other than using visible= method, please elaborate!

I gave up trying to have Perl make pages of 100 with “next prev” links to the data so I resorted to using css javascript onclick=yadayada to “display the data”.

I thought it would be easier to shift off 100 lines of the array in a loop and put the lines in their own html tables. Not.

I have failed miserably and need assistance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:07:24+00:00Added an answer on May 17, 2026 at 10:07 pm
    my $cnt = 0;
    
    while (@array) {
        my @rows = splice @array, 0, 100;
        print qq(<table id="t$cnt">\n);
        for my $row (@rows) {
            print "<tr><td>$row</td></tr>\n";
        }
        print "</table>\n";
        ++$cnt;
    }
    

    You may want to use HTML::Table for generating HTML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Perl's system() starts a process, but breaks the parent/child relationship? test.pl: use POSIX; system(./test.sh
I know that is better to use Python to call Posix and Win API,
I need to use system-specific functions, e.g. ftello() (defined in stdio.h as per POSIX
use strict; use warnings; use Time::HiRes qw(sleep); use Test::WWW::Selenium; use Test::More no_plan; use Test::Exception;
#!/usr/bin/env perl use warnings; use 5.014; use Term::Cap; use POSIX; my $termios = new
in a single main() function,so need signal handling. Use Posix Message Queue IPC mechanism
I tend to use POSIX Threads , when programming in C, under Linux .
I use POSIX threads on iPhone/iPad and when I try to destroy a mutex,
I am looking to use POSIX message queues on a single process multi threaded
Below is my shell script that is working fine. #!/bin/bash DATE_YEST_FORMAT2=`perl -e 'use POSIX

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.