App::colourhexdump::ColourProfile - A Role for Colour Profiles
version 0.01011318
package App::colourhexdump::ColourProfileName use Moose; with qw( App::colourhexdump::ColourProfile ); sub get_colour_for { my ( $self, $char ) = @_ ; ... return "\e[31m" if /badthings/; return undef; # don't colour } sub get_display_symbol_for { my ($self, $char) = @_ ; ... return '.' if $char =~ /badthings/ return $char; # printable }
my $colour = $object->get_colour_for( "\n" );
Return any string of data that should be prepended every time a given character is seen.
Generally, you only want to print ANSI Escape codes.
Don't worry about resetting things, we put a ^[[0m in for you.
Return undef if you do not wish to apply colouring.
undef
my $symbol = $object->get_display_symbol_for( "\n" );
Returns a user viewable alternative to the matched string.
Wraps get_colour_for and returns either a string sequence or ''.
Wraps get_colour_for and returns either an ANSI Reset Code, or '', depending on what was returned.
Kent Fredric <kentnl@cpan.org>
This software is copyright (c) 2013 by Kent Fredric <kentnl@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::colourhexdump, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::colourhexdump
CPAN shell
perl -MCPAN -e shell install App::colourhexdump
For more information on module installation, please visit the detailed CPAN module installation guide.