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
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Excellent work guys (Score:1)
If you drop the following into Color.pm it should enable color display on windows (assuming Win32::Console::ANSI is installed).
use constant IS_WIN32 => ( $^O =~
my $NO_COLOR;
BEGIN {
$NO_COLOR = 0;
if( IS_WIN32 ) {
eval 'use Win32::Console::ANSI;use Term::ANSIColor';
Re:Excellent work guys (Score:2)
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.
Reply to This
Parent
Re: (Score:1)
My activestate perl does.
G:\Documents and Settings\link>perl -e"print $^O . \"\n\";"
MSWin32
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.
Re: (Score:2)
Thanks. By the way, your one-liner can be simplified with the 'l' (el) switch which forces a newline after every print:
That's very handy when I'm writing quick utilities.