Rotation cyphers are not useful as meaningful encryption, only as content obfuscation. Using tr/// is the standard method of implementing Rot13 in Perl (at least to the extent that there actually exists standard ways of doing anything in Perl). Here's an example from perlfilter:

WRITING A SOURCE FILTER IN PERL
The easiest and most portable option available for creating your own source filter is to write it completely in Perl. To distinguish this from the previous two techniques, I'll call it a Perl source filter.

To help understand how to write a Perl source filter we need an example to study. Here is a complete source filter that performs rot13 decoding. (Rot13 is a very simple encryption scheme used in Usenet postings to hide the contents of offensive posts. It moves every letter forward thirteen places, so that A becomes N, B becomes O, and Z becomes M.)

package Rot13 ; use Filter::Util::Call ; sub import { my ($type) = @_ ; my ($ref) = [] ; filter_add(bless $ref) ; } sub filter { my ($self) = @_ ; my ($status) ; tr/n-za-mN-ZA-M/a-zA-Z/ if ($status = filter_read()) > 0 ; $status ; } 1;

All Perl source filters are implemented as Perl classes and have the same basic structure as the example above.


Dave


In reply to Re^3: my first japh by davido
in thread my first japh by stonecolddevin

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.