NAME
PerlIO::via::Rotate - PerlIO layer for encoding using rotational deviation
SYNOPSIS
use PerlIO::via::Rotate; # assume rot13 only
use PerlIO::via::Rotate 13,14,15; # list rotations (rotxx) to be used
use PerlIO::via::Rotate ':all'; # allow for all possible rotations 0..26
open( my $in,'<:via(rot13)','file.rotated' )
or die "Can't open file.rotated for reading: $!\n";
open( my $out,'>:via(rot14)','file.rotated' )
or die "Can't open file.rotated for writing: $!\n";
DESCRIPTION
This module implements a PerlIO layer that works on files encoded using rotational deviation. This is a simple manner of encoding in which pure alphabetical letters (a-z and A-Z) are moved up a number of places in the alphabet.
The default rotation is "13". Commonly this type of encoding is referred to as "rot13" encoding. However, any rotation between 0 and 26 inclusive are allowed (albeit that rotation 0 and 26 don't change anything). You can specify the rotations you would like to use as a list in the -use- statement.
The special keyword ":all" can be specified in the -use- statement to indicate that all rotations between 0 and 26 inclusive should be allowed.
CAVEATS
This module is special insofar it serves as a front-end for 27 modules that are named "PerlIO::via::rot0" through "PerlIO::via::rot26" that are eval'd as appropriate when the module is -use-d. The reason for this approach is that it is currently impossible to pass parameters to a PerlIO layer when opening a file. The name of the module is the implicit parameter being passed to the PerlIO::via::Rotate module.
SEE ALSO
PerlIO::via, PerlIO::via::Base64, PerlIO::via::MD5, PerlIO::via::QuotedPrint, PerlIO::via::StripHTML.
COPYRIGHT
Copyright (c) 2002 Elizabeth Mattijsen. Inspired by Crypt::Rot13.pm by Julian Fondren.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.