The query string holds the contents of all variables passed to the script, not
a single variable. It's a string. In the lines:
$next = ++$current;
$prev = --$current;
what you're doing really is increment the value of $current and assign the new
value to $next. Same thing for $prev which equals the new value of $current
after decrementing it by one. Remove these 2 lines to see how the QUERY_STRING
looks like before attempting to modify it.
BTW: $next = ++$current is not the same as $next = $current + 1. It's the same
as $current = $current+1; $next = $current;
On Sat, 2 Jun 2001 20:29:18 -0700, Derek Duhon said:
> I have a print statement that prints out an html page, and after a lot of tinkering,
>I still can't get it to work. It prints out the html perfectly, but I can't seem to
>find a way for it to print the contents of the scalar statements. The print
>statement is encased in "". Here is my source
>
> #!usr/local/bin/perl
> #
> #Program to generate endless webpage
> $current = $ENV{"QUERY_STRING"};
> $next = ++$current;
> $prev = --$current;
> print "Content-type: text/html\n\n<HTML><HEAD><TITLE>Endless!</TITLE></HEAD><BODY
>BGCOLOR = "#000000"><FONT COLOR = "red"><H5>$current</H5><HR COLOR = "red"><A HREF =
>"endless?$prev">Previous Page</a> | <A HREF = "endless?$next">Next
>Page</A></FONT></BODY></HTML>";
>
>
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com