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

I want to use for these function for the Win32:: Console in Linux

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

Replies are listed 'Best First'.
Re^3: I want to use Win32::Console in Linux is it possible?
by hippo (Archbishop) on Mar 23, 2022 at 12:23 UTC

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


    🦛

      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.