korda
korda

Reputation: 822

How to handle colored output from command in perl?

I need to execute command from Perl script and print it's output, however command output is colored and Perl prints something like that:

ESC[33m sample text ESC[m 

instead of coloring sample text.

In other words: I want to know how to handle already colored input in Perl (not how to create colored output)

Upvotes: 3

Views: 303

Answers (2)

Jean
Jean

Reputation: 22725

I would start with the colorstrip function in Term::ANSIColor

Upvotes: 9

toolic
toolic

Reputation: 62163

uncolor

uncolor takes input from files or standard input and returns in with colors and attributes stripped.

Upvotes: 4

Related Questions