useful snippet for win32 users, converts line breaks from *nix to win32 via the @ARGV array, so it works via command line and drap & drop. if you know how, you can even put it in the right-click file context menu. you could also switch the chars for $r and $n and use it on *nix systems.
if(!@ARGV) { print <<"EOC"; Usage: reformat.exe -b files [-b] : include this flag if you would like to automatically backup all files being reformatted [files] : files to reformat EOC sleep; } @f = @ARGV; if($ARGV[0] eq '-b') { $b = 1; shift(@ARGV); } else { $b = 0; } foreach $f (@f) { $f =~ s/\\/\//g; open(FILE,"$f"); @file = <FILE>; close(FILE); if($b) { open(BKUP,">$f.bak"); foreach $i (@file) {print BKUP $i} close(BKUP); } foreach (@file) {chomp} $file = join("\n",@file); $r = chr(13); $n = chr(10); $file =~ s/$r/$n/g; open(FILE,">$f"); print FILE $file; close(FILE); }

In reply to Text reformat by EvanK

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.