commit cf63cb0dbfbdd1358d5c6e8ba61188a68e3546f1 parent feeb729f04bfc67418f3875ab9521ea764d1e413 Author: Antoine Amarilli <a3nm@a3nm.net> Date: Sat, 15 Dec 2012 22:15:49 +0100 +length.pl Diffstat:
length.pl | | | 28 | ++++++++++++++++++++++++++++ |
1 file changed, 28 insertions(+), 0 deletions(-)
diff --git a/length.pl b/length.pl @@ -0,0 +1,28 @@ +#!/usr/bin/perl -C7 + +use utf8; + +my $offset = 0; +my $i; + +while (<>) { + chop; + if (/^([^ ]*)( [^\/].*)$/) { + #for ($i = 0; $i < $offset; $i++) { + # print " "; + #} + #print "^\n"; + print "$1"; + for ($i = 0; $i < $offset - length($1) - 1; $i++) { + print " "; + } + print "$2\n"; + $offset = length($1) + 1 if $offset == 0; + $offset += length($2) - 4; + $offset = 0 if not /\.\.\.$/; + } else { + print; + print "\n"; + } +} +