Thanks jlongino, I have taught myself this code, and someties my approach towards things my be uncoventional, like writting a line all the way out in a straight line, without indentation. It is how I read it best. I know that "{" starts a funtion and "}" stops it. Anything in between is what I want to do. Sorry about the __data__ mistake, this was the first time I have every posted. Anyway I have my script working now, but could you tell me why using the "my"s are so important? And here is a slice from my new code.
$cmd = $in{'cmd'}; $this = $in{'this'}; if (($cmd eq 'display') && ($this eq 'page1')) { $title = "Free Hosting Table Page 1"; $bline = 0; $eline = 99; &displaypage; } elsif (($cmd eq 'display') && ($this eq 'page2')) { $title = "Free Hosting Table Page 2"; $bline = 100; $eline = 199; &displaypage; } elsif (($cmd eq 'display') && ($this eq 'page3')) { $title = "Free Hosting Table Page 3"; $bline = 200; $eline = 299; &displaypage; } elsif (($cmd eq 'display') && ($this eq 'page4')) { $title = "Free Hosting Table Page 4"; $bline = 300; $eline = 399; &displaypage; } elsif (($cmd eq 'display') && ($this eq 'page5')) { $title = "Free Hosting Table Page 5"; $bline = 400; $eline = 499; &displaypage; } elsif (($cmd eq 'display') && ($this eq 'page6')) { $title = "Free Hosting Table Page 6"; $bline = 500; $eline = 599; &displaypage; } elsif (($cmd eq 'display') && ($this eq 'page7')) { $title = "Free Hosting Table Page 7"; $bline = 600; $eline = 629; &displaypage; } sub displaypage { &print_header; open(FILE, "<data/data.txt"); @lines = <FILE>; close(FILE); $linenum = 1; $altnum = 1; print "<center><table border=\"0\" cellpadding=\"3\" width=\"598\" bgc +olor=\"#000080\"><tr bgcolor=\"#000099\"><td colspan=\"2\">Free Host +Name<\/td><td align=\"center\">Space<\/td><td align=\"center\">Upload +s<\/td><td align=\"center\">Forced Ads<\/td><td align=\"center\">Scri +pts<\/td><td align=\"center\">Features<\/td><\/tr>\n"; foreach $item (@lines[$bline..$eline]) { @thisArray = split(/\|/, $item); if ($altnum eq "1") { $altnum = 0; $bgc = "#000080"; } elsif ($altnum eq "0") { $altnum = 1; $bgc = "#000099"; } print "<tr bgcolor=\"$bgc\"><td align=\"center\">@thisArray[0]<\/td><t +d><a href=\"goto.cgi?@thisArray[0]\">@thisArray[1]<\/a><\/td><td alig +n=\"center\">@thisArray[6] MB<\/td><td>@thisArray[7]<\/td><td align=\ +"center\">@thisArray[5]<\/td><td align=\"center\">@thisArray[10]<\/td +><td align=\"center\"><a href=\"more.cgi?@thisArray[0]\">more<\/a><\/ +td><\/tr>"; $linenum++; } &last; } sub last { print "<\/td><\/tr><\/table>\n\n"; &print_footer; } sub print_header { print <<"EOF"; <html> <head> <title>$title</title> <STYLE> <!-- body { scrollbar-face-color: #000099;scrollbar-shadow-color: #ffffff;s +crollbar-highlight-color: #ffffff;scrollbar-3dlight-color: #0000ff;sc +rollbar-darkshadow-color: #000070;scrollbar-track-color: #000000;scro +llbar-arrow-color: #0000ff } td { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11 +px } .head { font-family: Verdana, Arial, Helvetica; font-size: 24px; white +-space: nowrap; letter-spacing: .1em} .block { font-family: Verdana, Arial, Helvetica; font-size: 12px; whit +e-space: nowrap; letter-spacing: .1em} .alltext { font-family: Verdana, Arial, Helvetica, sans-serif; font-si +ze: 11px; letter-spacing: .05em} //--> </STYLE> </head> <BODY BGCOLOR="#000080" TEXT="#FFFFFF" LINK="#ffff66" VLINK="#ffff66" +> <center> <span class="head"> $title<br> </span> <p> <span class="alltext"> EOF } sub print_footer { print <<"EOF"; </span> <p><br> </body></html> EOF }

In reply to Re: Re: Re: Re: How do I extract (x) number of lines from database? by Anonymous Monk
in thread How do I extract (x) number of lines from database? by Mosley

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.