bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new module: update-copyright [Re: copyright years: mass-update every


From: Akim Demaille
Subject: Re: new module: update-copyright [Re: copyright years: mass-update every January 1
Date: Wed, 12 Aug 2009 11:48:08 +0200


Le 31 juil. 09 à 15:52, Joel E. Denny a écrit :

Hi Joel,

+        # Format within margin.
+        my $new_wrapped;
+        my $text_margin = $margin - length($prefix);
+        while (length($new))
+          {
+            if (($new =~ s/^(.{1,$text_margin})(?: |$)//)
+                || ($new =~ s/^([\S]+)(?: |$)//))
+              {
+                my $line = $1;
+                $new_wrapped .= $new_wrapped ? "\n" : $leading;
+                $new_wrapped .= "$prefix$line";
+              }
+            else
+              {
+ # Should be unreachable, but we don't want an infinite
+                # loop if it can be reached.
+                die;
+              }
+          }

You might want to have a look at Text::Wrap.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]