12 May 2019 02:32:50 UTC
- Distribution: Text-Control
- Module version: 0.5
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (2203 / 0 / 0)
- KwaliteeBus factor: 1
- 100.00% Coverage
- License: perl_5
- Activity24 month
- Download (10.39KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionFELIPE Felipe Gasperand 1 contributors
- Felipe M. L. Gasper ()
- NONPRINTABLE BYTES
Text::Control - Transforms of control characters
use Text::Control; Text::Control::to_dot("\x00\\Hi\x7fthere.\x80\xff"); # .\Hi.there... Text::Control::to_hex("\x00\\Hi\x7fthere.\x80\xff"); # \x00\\Hi\x7fthere.\x80\xff -- note the escaped backslash
These are transforms that I find useful for debugging. Maybe you will, too?
This module considers byte numbers 32 - 126 to be “printable”; i.e., they represent actual ASCII characters. Anything outside this range is thus “nonprintable”.
Transforms each nonprintable byte into a dot (
., ASCII 46) and returns the result.
Transforms each nonprintable byte into the corresponding \x.. sequence, appropriate for feeding into
eval(). For example, a NUL byte comes out as
In order to make this encoding reversible, backslash characters (
\) are double-escaped (i.e.,
This transforms the result of
to_hex()back into its original form. I’m not sure this is actually useful :), but hey.
Felipe Gasper (FELIPE)
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
Module Install Instructions
To install Text::Control, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Text::Control
For more information on module installation, please visit the detailed CPAN module installation guide.