HEX
Server: Apache
System: Linux iad1-shared-b8-33 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User: samfetchero1 (10301780)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/share/doc/libtext-reform-perl/examples/demo.pl
#! /usr/bin/perl -ws

# TRY DOING *THIS* WITH format!

use Text::Reform qw(form break_with);

my $text = join "", map "line $_\n", (1..20);

@lines = form { 
	pagelen=>9,
	header => sub { "Page $_[0]\n"."="x50 },
	footer => sub { my ($pagenum, $lastpage) = @_;
			return "" if $lastpage;
			return "-"x50 . "\n" . form ">"x50, "...".($pagenum+1);
		      },
	pagefeed => "\n"x10
	},
"      [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[\n",
       \$text;

print @lines;