Term::ANSIColor::Print

Create and/or print strings with ANSI color markup
Download

Term::ANSIColor::Print Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Dylan Doxey
  • Publisher web site:
  • http://search.cpan.org/~dylan/

Term::ANSIColor::Print Tags


Term::ANSIColor::Print Description

Create and/or print strings with ANSI color markup Term::ANSIColor::Print is a natural language way of indicating how you want your strings to look.SYNOPSISBasic usage use Term::ANSIColor::Print; my $print = Term::ANSIColor::Print->new(); $print->green('go!'); $print->red('stop!'); my @words = qw( one two three ); $print->yellow(\@words); $print->yellow(@words);Color aliases use Term::ANSIColor::Print; my $print = Term::ANSIColor::Print->new( alias => { good => 'white_on_green', bad => 'yellow_on_red', }, ); $print->good('happy new year!'); $print->bad('there has been a disturbance in the force'); # omit traling line break with trailing _ $print->normal_( "performing activity ... " ); if ( perform_activity() ) { $print->good('OK!'); } else { $print->bad('disapointment'); }Checkers use Term::ANSIColor::Print; my $string = Term::ANSIColor::Print->new( output => 'return', eol => '', ); my $red = $string->on_red(' '); my $white = $string->on_white(' '); my $red_pad = Term::ANSIColor::Print->new( pad => $red, output => 'return', eol => '', ); my $white_pad = Term::ANSIColor::Print->new( pad => $white, output => 'return', eol => '', ); my $checkers_a = $red_pad->normal( map { $white } ( 0 .. 5 ) ); my $checkers_b = $white_pad->normal( map { $red } ( 0 .. 5 ) ); my $checker_board = Term::ANSIColor::Print->new( pad => "\n$checkers_a\n", ); $checker_board->normal( map { $checkers_b } ( 0 .. 4 ) ); Requirements: · Perl


Term::ANSIColor::Print Related Software