Hi belg4mit,

Actually I do care about white space and etc though you can't tell that from my original post. With the help I got from you helpful monks here's what I ended up with ...
$ cat text_ob.pl #!/usr/bin/perl -w use strict; sub randchar { return chr int(rand(26)) + 65; } sub randchar2 { my $t = shift; return chr int(rand(26)) + 65 if $t =~ /[a-zA-Z]/; return int(rand(9)) if $t =~ /\d/; return $t; } while (<>) { s/(.)/&randchar2($1)/ge; print $_; } $ ./text_ob.pl < text_ob.pl #!/VYX/ZEE/AOIV -M MVV AMGMXL; YHN DTRQSXDS { GJAHJL MMY BMO(OLTR(18)) + 70; } FZJ EVXHJEPY7 { KP $U = RLOFG; VCDZBZ VOD GAU(GHOE(70)) + 67 ZF $F =~ /[E-V|D-K]/; RPYZOA ADX(ERSW(1)) EM $E =~ /\R/; GDQIZW $W; } VKSXA (<>) { F/(.)/&XDGFXIBL8($8)/QW; DTMTE $_; }

In reply to Re: Re: s/\w/random character/g by Plankton
in thread s/\w/random character/g by Plankton

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.