File: Wrap.pm.diff

package info (click to toggle)
cowsay 3.03+dfsg2-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 512 kB
  • sloc: perl: 169; sh: 68; python: 16; makefile: 9
file content (47 lines) | stat: -rw-r--r-- 879 bytes parent folder | download | duplicates (11)
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;