<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: text formatting code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sun, 18 May 2008 04:33:01 GMT</pubDate>
    <description>DZone Snippets: text formatting code</description>
    <item>
      <title>Tabs-to-space function</title>
      <link>http://snippets.dzone.com/posts/show/4269</link>
      <description>This Perl function returns its argument with any tabs it contained converted into the appropriate number of spaces.&lt;br /&gt;&lt;code&gt;sub tabs2space($) {&lt;br /&gt; my $str = shift;&lt;br /&gt; 1 while $str =~ s/\t+/' ' x (length($&amp;)*8 - length($`)%8)/e;&lt;br /&gt; return $str;&lt;br /&gt;}&lt;/code&gt;</description>
      <pubDate>Fri, 06 Jul 2007 05:51:42 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4269</guid>
      <author>Minimiscience (Guildorn Tanaleth)</author>
    </item>
    <item>
      <title>Paragraph formatter</title>
      <link>http://snippets.dzone.com/posts/show/4245</link>
      <description>Converts any nonempty lines in a document that don't start with whitespace into more conventional paragraphs&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#!/usr/bin/perl -wni&lt;br /&gt;# para.pl&lt;br /&gt;use strict;&lt;br /&gt;&lt;br /&gt;/^\s+/ || /^$/ ? print : write;&lt;br /&gt;format ARGVOUT =&lt;br /&gt;        ^&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;br /&gt;$_&lt;br /&gt;^&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;~~&lt;br /&gt;$_&lt;br /&gt;.&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 05 Jul 2007 02:13:46 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4245</guid>
      <author>Minimiscience (Guildorn Tanaleth)</author>
    </item>
  </channel>
</rss>
