Re: 'safe' printing to the terminal

[email protected] (Russ Allbery) Sun, 10 May 2026 17:22:36 -0700
Newsgroups perl.perl5.porters
Organization The Eyrie
Message-ID <[email protected]>
Dan <[email protected]> writes:

> https://metacpan.org/pod/Term::ANSIColor (which is core) has a colorstrip
> function, but I don't know if it covers all the use cases desired here.

It doesn't. It only acts on the terminal formatting escape sequences that
end in "m" and leaves all other ones alone.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print