File: demo_toc.pl

package info (click to toggle)
libperl6-form-perl 0.090-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 584 kB
  • sloc: perl: 3,080; makefile: 8
file content (31 lines) | stat: -rwxr-xr-x 610 bytes parent folder | download | duplicates (7)
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
use Perl6::Form;

for (<DATA>) {
	($title, $page) = split /[\t\n]+/;
	push @contents, $title;
	push @page, $page;
}

print form
	 {page=>{width=>51},hfill=>'=-'},
	 "{||||{*}|||||}\n\n",
	 "[ Table of Contents ]",
	 {hfill=>' .'},
	 "   {[[[[[{*}[[[[[}{]]]}   ",
	     \@contents,    \@page;

__DATA__
Foreword			i
Preface				iii
Glossary			vi
Introduction		1
The Tempest			7
Two Gentlemen of Verona		17
The Merry Wives of Winsor	27
Twelfh Night				39
Measure for Measure			50
Much Ado About Nothing		62
A Midsummer Night's Dream	73
Love's Labour's Lost		82
The Merchant of Venice	    94
As You Like It				105