| PerlIO-via-escape_ansi documentation | view source | Contained in the PerlIO-via-escape_ansi distribution. |
PerlIO::via::escape_ansi - PerlIO layer to escape ANSI sequences
This is the documentation of PerlIO::via::escape_ansi version 0.01
# used as a PerlIO layer
use PerlIO::via::escape_ansi;
open my $fh, "<:via(escape_ansi)", $file or die $!;
print <$fh>;
# used as a function
use PerlIO::via::escape_ansi -as_function;
print escape_non_printable_chars($unsure_data);
This module is a proof of concept and a very simple PerlIO layer for escaping non-printable characters, in order to prevent from shell attacks with ANSI sequences. The internal function can also be directly called.
Note: This is an experimental module, most probably with bugs and
memory leaks, used as a prototype for the true module, PerlIO::escape_ansi
which will be written using the XS API of PerlIO.
"\e[1mbold text"
"<ESC>[1mbold text"
"\e]0;OH HAI\a"
"<ESC>]0;OH HAI<BEL>"
"\a\e[2J\e[2;5m\e[1;31mI CAN HAS UR PWNY\n\e[2;25m\e[22;30m\e[3q"
"<BEL><ESC>[2J<ESC>[2;5m<ESC>[1;31mI CAN HAS UR PWNY<LF><ESC>[2;25m<ESC>[22;30m<ESC>[3q"
No functions is exported by default, but you can import the
escape_non_printable_chars() by calling the module with the argument
-as_function:
use PerlIO::via::escape_ansi -as_function;
Direct call (minus the Perl and XS wrappers) to the internal C function that does the real work.
Mark Overmeer, who suggested that such a module should be written (see RT-CPAN #41174).
Sébastien Aperghis-Tramoni, <sebastien at aperghis.net>
Please report any bugs or feature requests
to bug-perlio-escape_ansi at rt.cpan.org, or through the web interface
at http://rt.cpan.org/Dist/Display.html?Queue=PerlIO-escape_ansi.
I will be notified, and then you'll automatically be notified of progress
on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc PerlIO::escape_ansi
You can also look for information at:
http://rt.cpan.org/Dist/Display.html?Queue=PerlIO-escape_ansi
Copyright 2008, 2009 Sébastien Aperghis-Tramoni
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| PerlIO-via-escape_ansi documentation | view source | Contained in the PerlIO-via-escape_ansi distribution. |