I found a couple points in your code that could be causing the errors, so I'll reproduce your code and pinpoint the trouble-spots. It IS very good that you use -w and the CGI module. You don't need to "use vars", though, if you're not doing "use strict" (which you might not be ready for).

Here's the first iffyness. As of Perl 5, you no longer need to put an ampersand (&) in front of calls to non-builtin subroutines, and here, you're using it in front of a built-in, which makes it try to call a user-defined function. Remove the &, and one problem will be fixed.

You don't need quotes around a "simple" hash key (one that's just a string of letters, underscores, and numbers), and you don't need to test for equivelency to 1, you just need to see if the value is true.

It appears you've forgotten to actually put these in the @name and @email arrays. And before you think of using $name[$count] and $email[$count], please remember that arrays in Perl start at 0, and the preferred method of placing an element at the end of an array is via the push() function. And it's nicer (and smarter) to not slurp an entire file into an array, if you can avoid it:

First (and syntax-wise), you're missing the opening { on your while statement. But from a getting-things-done point of view, you should probably change this code a bit. You only want to print (at most) the first 10 sets of information, right? Then you could have done a few things differently: save only the first ten sets of information, and then stop processing the file; or you could get rid of that $x variable by testing $i twice (make sure it's less than 10 AND less than the number of elements in the arrays):

If anything I've suggested seems over your head, don't rush to using it, and instead, stick with things you're more familiar with. We can discuss this on the forum so that other people that might not totally get this can better understand it.

This means "$start is either the value of the 'start' parameter in the CGI query, or the number 0". The reason we need to manually supply the "or 0" option is because if there wasn't a 'start' parameter in the CGI query, the value is not 0, but undef, and when you use an undef value, Perl will usually let you know you probably shouldn't be doing that -- it won't kill your program, but it'll write a warning.

In fact, $start can be the variable you use in your loop (and here's where $end comes in). Oh, don't let the first statement in the for-loop condition fool you; it's merely setting two variables, $start and $end.

But, being me, I plonk that into one line. If $num is NOT 0, then there are still more records to be displayed, so we're going to display the "view next X" button. However, maybe there AREN'T 10 more records, but 5 or 2. So I get $num to be the difference between how many there are, and where we're currently at, and then I say: