File: internal_links.cgi

package info (click to toggle)
libcgi-pm-perl 3.49-1squeeze2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,044 kB
  • ctags: 354
  • sloc: perl: 6,095; makefile: 9
file content (33 lines) | stat: -rwxr-xr-x 1,019 bytes parent folder | download | duplicates (3)
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
#!/usr/local/bin/perl

use CGI;
$query = new CGI;

# We generate a regular HTML file containing a very long list
# and a popup menu that does nothing except to show that we
# don't lose the state information.
print $query->header;
print $query->start_html("Internal Links Example");
print "<H1>Internal Links Example</H1>\n";
print "Click <cite>Submit Query</cite> to create a state.  Then scroll down and",
    " click on any of the <cite>Jump to top</cite> links.  This is not very exciting.";

print "<A NAME=\"start\"></A>\n"; # an anchor point at the top

# pick a default starting value;
$query->param('amenu','FOO1') unless $query->param('amenu');

print $query->start_form;
print $query->popup_menu('amenu',[('FOO1'..'FOO9')]);
print $query->submit,$query->endform;

# We create a long boring list for the purposes of illustration.
$myself = $query->self_url;
print "<OL>\n";
for (1..100) {
    print qq{<LI>List item #$_ <A HREF="$myself#start">Jump to top</A>\n};
}
print "</OL>\n";

print $query->end_html;