forked from tnalpgge/rank-amateur-cowsay
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Wrap.pm.diff
47 lines (41 loc) · 879 Bytes
/
Wrap.pm.diff
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
*** Wrap.pm.in Thu May 22 00:21:42 1997
--- Wrap.pm Fri Nov 12 10:00:15 1999
***************
*** 3,9 ****
require Exporter;
@ISA = (Exporter);
! @EXPORT = qw(wrap);
@EXPORT_OK = qw($columns);
$VERSION = 97.011701;
--- 3,9 ----
require Exporter;
@ISA = (Exporter);
! @EXPORT = qw(wrap fill);
@EXPORT_OK = qw($columns);
$VERSION = 97.011701;
***************
*** 66,71 ****
--- 66,90 ----
print "-----------$r---------\n" if $debug;;
return $r;
+ }
+
+ ## Copied up from below.
+ sub fill
+ {
+ my ($ip, $xp, @raw) = @_;
+ my @para;
+ my $pp;
+
+ for $pp (split(/\n\s+/, join("\n",@raw))) {
+ $pp =~ s/\s+/ /g;
+ my $x = wrap($ip, $xp, $pp);
+ push(@para, $x);
+ }
+
+ # if paragraph_indent is the same as line_indent,
+ # separate paragraphs with blank lines
+
+ return join ($ip eq $xp ? "\n\n" : "\n", @para);
}
1;