When a CGI script is called several environment variables are set and you can Perl/associativeenvironment access these from Perl To see what some of the environment variables are you can try the example perl CGI script at
Perl/environment-example Perl/environment-example
This program simply accesses Perl's associative %ENV array to print out the values of the environment variables. You can have a look at the Perl/displaytext/environment-example source of this program to see how it accesses the variables.
Possibly the most useful of these environment variables is the QUERY_STRING variable. In the above example this was the empty string, but if we append, say, ?something onto the end of the URL then the string after the ? gets put into the environment variable QUERY_STRING. Try opening the following URLs. The first one is the same as we used above.
Perl/environment-example Perl/environment-example Perl/environment-example?something Perl/environment-example?something Perl/environment-example?1 Perl/environment-example?1 Perl/environment-example?2 Perl/environment-example?2 Perl/environment-example?two+words Perl/environment-example?two+words
The endless document is called initially with QUERY_STRING equal to 1, and anchors to the previous and next pages have their query string calculated from this. You may also like to extend the use of QUERY_STRING so that instead of just containing the intended page number it also contains the value of the last page visited.
Bhopal news
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100