Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I just had a look and all the tests are passing for me on windows.

    If you drop the following into it should enable color display on windows (assuming Win32::Console::ANSI is installed).

    use constant IS_WIN32 => ( $^O =~ /^(MS)?Win32$/ );

    my $NO_COLOR;

    BEGIN {
            $NO_COLOR = 0;
            if( IS_WIN32 ) {
                    eval 'use Win32::Console::ANSI;use Term::ANSIColor';
    • That would certainly be a nice bonus for Windows users. Are you sure that $^O sometimes returns MSWin32? I thought it was always Win32. If this is documented somewhere, I'd love to read that.

      • I'm not really sure. Tbh I just copied and pasted it from else where ( and

        My activestate perl does.

        G:\Documents and Settings\link>perl -e"print $^O . \"\n\";"

        As for docs , perldoc perlvar says

        In Windows platforms, $^O is not very helpful: since it is always MSWin32 , it doesn't tell the difference between 95/98/ME/NT/2000/XP/CE/.NET. Use Win32::GetOSName() or Win32::GetOSVersion() (see Win32 and perlport) to distinguish between the variants.