There is an ongoing outage on the primary CPAN mirror. It is possible to work around the issue by using MetaCPAN as a mirror.

NAME

ANSI Encode

SYNOPSIS

A markup language to generate basic ANSI text

AUTHOR & COPYRIGHT

Richard Kelsch

Copyright (C) 2025 Richard Kelsch
All Rights Reserved
Perl Artistic License

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

http://www.perlfoundation.org/artistic_license_2_0

Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.

If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.

This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.

This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.

Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

USAGE

ansi_encode.pl file

OPTIONS

--version or -v

Shows name, version information and brief licensing information.

--help or -h

Simple usage and options documentation

--tokens or -y

Shows the most used tokens available. A token is encapsulated within [% and %] (with at lease one space on each side)

--rawtokens or r

Raw dump of useable tokens.

--symbols or -s [search]

Similar to "tokens", but instead shows special symbol character tokens names.

You may also add a search string to shorten the list.

IT IS HIGHLY SUGGESTED YOU USE A SEARCH STRING.

--unicode or -u [search]

Similar to "tokens", but instead shows special symbol characters by unicode.

You may also add a search string to shorten the list.

IT IS HIGHLY SUGGESTED YOU USE A SEARCH STRING.

--dump or -d [search]

Does a raw dump of the symbols.

--full or -f

Enables the full symbol tree. Initialization is slower. It his highly recommended that you use a search string.

    [% RED %]This is written in red[% RESET %]

    RESET changes output text to normal.

TOKENS

GENERAL

RETURN     = ASCII RETURN (13)
LINEFEED   = ASCII LINEFEED (10)
NEWLINE    = RETURN + LINEFEED (13 + 10)
CLEAR      = Places cursor at top left, screen cleared
CLS        = Same as CLEAR
CLEAR LINE = Clear to the end of line
CLEAR DOWN = Clear down from current cursor position
CLEAR UP   = Clear up from current cursor position
RESET      = Reset all colors and attributes

CURSOR

UP          = Moves cursor up one step
DOWN        = Moves cursor down one step
RIGHT       = Moves cursor right one step
LEFT        = Moves cursor left one step
SAVE        = Save cursor position
RESTORE     = Place cursor at saved position
BOLD        = Bold text (not all terminals support this)
FAINT       = Faded text (not all terminals support this)
ITALIC      = Italicized text (not all terminals support this)
UNDERLINE   = Underlined text
SLOW BLINK  = Slow cursor blink
RAPID BLINK = Rapid cursor blink

ATTRIBUTES

INVERT       = Invert text (flip background and foreground attributes)
REVERSE      = Reverse
CROSSED OUT  = Crossed out
DEFAULT FONT = Default font

FRAMES

BOX & ENDBOX = Draw a frame

COLORS

NORMAL = Sets colors to default

FOREGROUND

BLACK          = Black
RED            = Red
PINK           = Hot pink
ORANGE         = Orange
NAVY           = Deep blue
GREEN          = Green
YELLOW         = Yellow
BLUE           = Blue
MAGENTA        = Magenta
CYAN           = Cyan
WHITE          = White
DEFAULT        = Default foreground color
BRIGHT BLACK   = Bright black (dim grey)
BRIGHT RED     = Bright red
BRIGHT GREEN   = Lime
BRIGHT YELLOW  = Bright Yellow
BRIGHT BLUE    = Bright blue
BRIGHT MAGENTA = Bright magenta
BRIGHT CYAN    = Bright cyan
BRIGHT WHITE   = Bright white

BACKGROUND

B_BLACK          = Black
B_RED            = Red
B_GREEN          = Green
B_YELLOW         = Yellow
B_BLUE           = Blue
B_MAGENTA        = Magenta
B_CYAN           = Cyan
B_WHITE          = White
B_DEFAULT        = Default background color
B_PINK           = Hot pink
B_ORANGE         = Orange
B_NAVY           = Deep blue
BRIGHT B_BLACK   = Bright black (grey)
BRIGHT B_RED     = Bright red
BRIGHT B_GREEN   = Lime
BRIGHT B_YELLOW  = Bright yellow
BRIGHT B_BLUE    = Bright blue
BRIGHT B_MAGENTA = Bright magenta
BRIGHT B_CYAN    = Bright cyan
BRIGHT B_WHITE   = Bright white

HORIZONAL RULES

Makes a solid blank line, the full width of the screen with the selected background color

HORIZONTAL RULE RED             = A solid line of red background
HORIZONTAL RULE GREEN           = A solid line of green background
HORIZONTAL RULE YELLOW          = A solid line of yellow background
HORIZONTAL RULE BLUE            = A solid line of blue background
HORIZONTAL RULE MAGENTA         = A solid line of magenta background
HORIZONTAL RULE CYAN            = A solid line of cyan background
HORIZONTAL RULE PINK            = A solid line of hot pink background
HORIZONTAL RULE ORANGE          = A solid line of orange background
HORIZONTAL RULE WHITE           = A solid line of white background
HORIZONTAL RULE BRIGHT RED      = A solid line of bright red background
HORIZONTAL RULE BRIGHT GREEN    = A solid line of bright green background
HORIZONTAL RULE BRIGHT YELLOW   = A solid line of bright yellow background
HORIZONTAL RULE BRIGHT BLUE     = A solid line of bright blue background
HORIZONTAL RULE BRIGHT MAGENTA  = A solid line of bright magenta background
HORIZONTAL RULE BRIGHT CYAN     = A solid line of bright cyan background
HORIZONTAL RULE BRIGHT WHITE    = A solid line of bright white background