in reply to Re^2: I want to use Win32::Console in Linux is it possible?
in thread I want to use Win32::Console in Linux is it possible?

If you are only concerned with colours, then Term::ANSIColor might be a good place to start.


🦛

  • Comment on Re^3: I want to use Win32::Console in Linux is it possible?

Replies are listed 'Best First'.
Re^4: I want to use Win32::Console in Linux is it possible?
by Anonymous Monk on Mar 23, 2022 at 12:36 UTC

    This code can anyone change with the Term::ANSIColor Library

    our $console = Win32::Console->new(STD_OUTPUT_HANDLE); our $CurrentConsoleColor = $console->Attr; our $BackgroundColor = $CurrentConsoleColor & (BACKGROUND_RED|BACKGROU +ND_BLUE|BACKGROUND_GREEN|BACKGROUND_INTENSITY);

      Have you looked at the Term::ANSIColor documentation? The first line reads

      print color('blue');

      Maybe you can change that to your needs.

      You cannot ask the terminal for the current color though, if that is what you need.