File: rewrap.pl

package info (click to toggle)
irssi-scripts 20120326
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,500 kB
  • sloc: perl: 60,045; sh: 146; makefile: 6
file content (21 lines) | stat: -rwxr-xr-x 403 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl

use strict;
use Text::Wrap;

$Text::Wrap::columns = 80;

open FH, "<", "debian/description-list";
my @a = <FH>;
foreach(@a) {
  chomp $_;
  if(length($_) > 80) {
    $_ =~ /^(.{30})(.*)$/;
    my $first = $1;
    my $description = $2;
    my $rest = "                              ";
    print $_ . "\n" foreach(wrap($first, $rest, ($description)));
  } else {
    print $_."\n";
  }
}