in reply to Re^2: Weird screen output in my AceShell module
in thread Weird screen output in my AceShell module

elsif ($^O eq "Linux") { eval { require Term::ANSIColor; }; }

is useless. You're using the functions from Term::ANSIScreen instead of those from Term::ANSIColor. Term::ANSIColor is a subset of Term::ANSIScreen, not the non-Windows equivalent of Win32::Console::ANSI.

Furthermore, you can simplify your program using the if pragma:

# Load ANSI driver if running in Windows. use if $^O eq 'MSWin32', 'Win32::Console::ANSI'; use Term::ANSIScreen qw/:color :cursor :screen :keyboard/; ...

Using the simpler code shouldn't fix anything, but since it will load Win32::Console::ANSI at compile time as if you had said use Win32::Console::ANSI;, it might.

Update: Added missing quotes as per reply.

Replies are listed 'Best First'.
Re^4: Weird screen output in my AceShell module
by Ace128 (Hermit) on Jul 15, 2006 at 21:25 UTC
    Ok, seems to be working now though. One thing I also noticed I missed was doing a function call like this: $self->functionCall() instead of just functionCall(); Stupid.

    Also, I get this with your code:
    Bareword "Win32::Console::ANSI" not allowed while "strict subs" in use at Constants.pm line 18.
    Execution of Constants.pm aborted due to compilation errors.
      oops, sorry, put it in quotes.