Minecraft::SectionFilter - Strip/Process magical § characters from minecraft
version 0.003004
use Minecraft::SectionFilter;
while(<$some_stream_of_text>){
if( $ENV{MODE} eq 'STRIP' ) {
print(strip_sections($_))
}
else {
print(ansi_encode_sections($_));
}
}
Parse a string into a series of elements;
my (@list) = translate_sections($string)
Resulting list will be a list of hashrefs, either:
{ type => text , content => "the string itself" }
or
{ type => section, section_code => $char }
Strip section codes from a string.
my $output = strip_sections( $input );
Translate section codes to Term::ANSIColor color codes.
STDOUT->print( ansi_encode_sections( $minecraft_string ) );
Minecraft::RCON which has a similar feature, except its not user-acessible/reusable.
Kent Fredric kentnl@cpan.org
This software is copyright (c) 2017 by Kent Fredric kentfredric@gmail.com.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.