Crypt::Rot13 man page on OpenServer

Man page or keyword search:  
man Server   5388 pages
apropos Keyword Search (all sections)
Output format
OpenServer logo
[printable version]

Rot13(3)	      User Contributed Perl Documentation	      Rot13(3)

NAME
       Crypt::Rot13 v0.6 - a simple, reversible encryption

SYNOPSIS
	 use Crypt::Rot13;

	 my $rot13 = new Crypt::Rot13;
	 $rot13->charge ("The quick brown fox jumped over the lazy dog.");
	 print $rot13->rot13 (), "\n";
	 print $rot13->rot13 (245.333), "\n";
	 print $rot13->peek (), "\n";

	 open (F, "/etc/passwd") or die "$!";
	 $rot13->charge (<F>);
	 close (F) or die "$!";
	 print $rot13->rot13 (-13);

	 while (<STDIN>) {
	   $rot13->charge ($_);
	   print $rot13->rot13 ();
	 }

	 $rot13->charge ('a' .. 'z');
	 foreach (0 .. 26) {
	   print $rot13->rot13 ($_), "\n";
	 }

DESCRIPTION
       rot13 is a simple encryption in which ASCII letters are rotated 13
       places (see below).  This module provides an array object with methods
       to encrypt its string elements by rotating ASCII letters n places down
       the alphabet.

       Think of it this way: all of the letters of the alphabet are arranged
       in a circle like the numbers of a clock.	 Also like a clock, you have a
       hand pointing at one of the letters: a.	Crypt::Rot13 turns the hand
       clockwise n times through 'b', 'c', 'd', etc, and back again to 'a', 26
       turns later.

       Crypt::Rot13 turns this hand for every letter of every string it con-
       tains a given number of times, the default of which is 13, or exactly
       half the number of letters in the alphabet.

PUBLIC METHODS
       * Crypt::Rot13->new (@arguments)
	   This creates a Crypt::Rot13 object, which is a blessed array refer-
	   ence.  Any arguments given to "new" define the array, which is
	   defaultly empty.

       * Crypt::Rot13->charge (@arguments)
	   Any arguments given to "charge" define the array.  If no arguments
	   are passed, the Crypt::Rot13 array will be empty.  The arguments
	   can be non-strings; see the following example.

	     my $rot13 = Crypt::Rot13->new ({'foo' => 'bar'}, 111);
	     print $rot13->peek (), "\n", $rot13->rot13 (), "\n";

       * Crypt::Rot13->peek ()
	   This dereferences and returns the Crypt::Rot13 object.

       (In case you are wondering, the strange method names of "peek" and
       "charge" are derived from my original conception of Crypt::Rot13 as a
       magical device.)

       * Crypt;:Rot13->rot13 ($degree)
	   Rotates ASCII alphabetical characters of each element of the array
	   degree times and returns the changed array without altering the
	   Crypt::Rot13 object.	 The degree can be negative and a fractional
	   part is ignored (to be precise, "chr" and "%" ignore it).

	   Degrees effectively equal to 13 are optimized to a "tr///".
	   Degrees effectively equal to 0 are optimized into a "peek".

	   A degree $d is "effectively equal" to 13 if "$d % 26 == 13".

LICENSE
       Copyright (C) 1999-2000 Julian Fondren

       This program is free software; you can redistribute it and/or modify it
       under the terms of the GNU General Public License as published by the
       Free Software Foundation; either version 2 of the License, or (at your
       option) any later version.

       This program is distributed in the hope that it will be useful, but
       WITHOUT ANY WARRANTY; without even the implied warranty of MER-
       CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
       Public License for more details.

       You should have received a copy of the GNU General Public License along
       with this program; if not, write to the Free Software Foundation, Inc.,
       59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

BUGS
       The algorithm of "rot13" isn't very easy to understand.

AUTHOR
       Julian Fondren

SEE ALSO
       perl(1) rot13(1)

perl v5.8.8			  2000-04-21			      Rot13(3)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server OpenServer

List of man pages available for OpenServer

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net