09 Nov 2019 15:35:57 UTC
- Distribution: PerlIO-via-Rotate
- Module version: 0.09
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (2 / 0 / 0)
- KwaliteeBus factor: 1
- 49.81% Coverage
- License: unknown
- Activity24 month
- Download (5.67KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionLNATION Robert Acock 🤞🌏and 1 contributors
- Elizabeth Mattijsen (firstname.lastname@example.org)
PerlIO::via::Rotate - PerlIO layer for encoding using rotational deviation
use PerlIO::via::Rotate; # assume rot13 only use PerlIO::via::Rotate 17; # only a single rotation use PerlIO::via::Rotate qw( 13 14 15 ); # list rotations (rotxx) to be used use PerlIO::via::Rotate ':all'; # allow for all 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";
This documentation describes version 0.09.
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 strings 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.
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.
Inspired by Crypt::Rot13.pm by Julian Fondren.
Also thanks to Ribasushi for pointing out at the first Niederrhein PM meeting in 10 years, that the module version check is done by UNIVERSAL::VERSION, and that you can bypass this by providing your own VERSION class method.
maintained by LNATION, <email@example.com>
Copyright (C) 2002, 2003, 2004, 2012 Elizabeth Mattijsen. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install PerlIO::via::Rotate, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install PerlIO::via::Rotate
For more information on module installation, please visit the detailed CPAN module installation guide.