
Reset in ANSIColor sets the background to black
--===============1968950480==
Content-Type: multipart/alternative; boundary=0016e64654cab2cdb804660cf985
--0016e64654cab2cdb804660cf985
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hi,
My current DOS background color is white with Black text. I use ANSIColor
module to print error messages in Red color. I use the Color command and I
face two issues:
1. The Red color error message text thats printed on DOS has black
background, instead of white only.
2. On typing CLS the background color changes to black and text color
changes to white.
What is my Expectation:
1. On prinitng the text in red color should not have the background color
black but use the current DOS background color(White in my case).
2. On doing CLS on DOS, the dos should maintain its background color(White
in my case) rather then setting it to default black background color.
My Code:
use Win32::Console::ANSI;
use Term::ANSIColor;
print color "Bold Red";
print "ERROR_MSG = xyz";
print color 'reset';
Any help is much appreciated.
Thanks,
Jai!
--0016e64654cab2cdb804660cf985
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hi,<br><br>My current DOS background color is white with Black text. I
use ANSIColor module to print error messages in Red color. I use the
Color command and I face two issues:<br><br>1. The Red color error message text thats printed on DOS has black background, instead of white only.<br>
2. On typing CLS the background color changes to black and text color changes to white.<br><br>What is my Expectation:<br>1.
On prinitng the text in red color should not have the background color
black but use the current DOS background color(White in my case). <br>
<br>2. On doing CLS on DOS, the dos should maintain its background
color(White in my case) rather then setting it to default black
background color.<br><br>My Code:<br>use Win32::Console::ANSI;<br>use Term::ANSIColor;<br>
print color "Bold Red";<br>print "ERROR_MSG = xyz";<br>print color 'reset';<br><br>Any help is much appreciated.<br><br>Thanks,<br>Jai!
--0016e64654cab2cdb804660cf985--
--===============1968950480==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1968950480==--
Re: Reset in ANSIColor sets the background to black
Perl Help wrote:
> Hi,
>
> My current DOS background color is white with Black text. I use
> ANSIColor module to print error messages in Red color. I use the Color
> command and I face two issues:
>
> 1. The Red color error message text thats printed on DOS has black
> background, instead of white only.
> 2. On typing CLS the background color changes to black and text color
> changes to white.
>
> What is my Expectation:
> 1. On prinitng the text in red color should not have the background
> color black but use the current DOS background color(White in my case).
>
> 2. On doing CLS on DOS, the dos should maintain its background
> color(White in my case) rather then setting it to default black
> background color.
>
> My Code:
> use Win32::Console::ANSI;
> use Term::ANSIColor;
> print color "Bold Red";
> print "ERROR_MSG = xyz";
> print color 'reset';
Seems OK to me on 5.8.8 B820. 5.001 & 5.006 on the modules, resp.
> p test.pl [switched my FG/BG to reverse (black on white) prior to test
Prior to error [black on white]
ERROR_MSG = xyz [this was red on white]
Done [black on white]
Everything came out fine as near as I can tell.
My code:
use strict;
use warnings;
use Win32::Console::ANSI;
use Term::ANSIColor;
print "Prior to error\n";
print color "Bold Red";
print "ERROR_MSG = xyz\n";
print color 'reset';
print "Done\n";
__END__
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Reset in ANSIColor sets the background to black
--===============1485487120==
Content-Type: multipart/alternative; boundary=001636284c745285da04661165e5
--001636284c745285da04661165e5
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hi Bill,
Thanks for your response. DId you try running CLS command after executing
the code. When I do that, it switches my FG/BG color to default that is
White on Black. More so, my code is not showing the same results as you
described. Is there any other file I need to take care off? Do you want me
to send you the screen shot how it looks like when I run the program?
Thanks once again for your help,
~Jai!
On Thu, Mar 26, 2009 at 3:53 PM, Bill Luebkert <dbecoll [at] roadrunner.com>wrote:
> Perl Help wrote:
>
>> Hi,
>>
>> My current DOS background color is white with Black text. I use ANSIColor
>> module to print error messages in Red color. I use the Color command and I
>> face two issues:
>>
>> 1. The Red color error message text thats printed on DOS has black
>> background, instead of white only.
>> 2. On typing CLS the background color changes to black and text color
>> changes to white.
>>
>> What is my Expectation:
>> 1. On prinitng the text in red color should not have the background color
>> black but use the current DOS background color(White in my case).
>>
>> 2. On doing CLS on DOS, the dos should maintain its background color(White
>> in my case) rather then setting it to default black background color.
>>
>> My Code:
>> use Win32::Console::ANSI;
>> use Term::ANSIColor;
>> print color "Bold Red";
>> print "ERROR_MSG = xyz";
>> print color 'reset';
>>
>
> Seems OK to me on 5.8.8 B820. 5.001 & 5.006 on the modules, resp.
>
> > p test.pl [switched my FG/BG to reverse (black on white)
> prior to test
> Prior to error [black on white]
> ERROR_MSG = xyz [this was red on white]
> Done [black on white]
>
> Everything came out fine as near as I can tell.
>
> My code:
>
> use strict;
> use warnings;
> use Win32::Console::ANSI;
> use Term::ANSIColor;
>
> print "Prior to error\n";
> print color "Bold Red";
> print "ERROR_MSG = xyz\n";
> print color 'reset';
> print "Done\n";
>
> __END__
>
>
--001636284c745285da04661165e5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi Bill,<br><br>Thanks for your response. DId you try running CLS command a=
fter executing the code. When I do that, it switches my FG/BG color to defa=
ult that is White on Black. More so, my code is not showing the same result=
s as you described. Is there any other file I need to take care off? Do you=
want me to send you the screen shot how it looks like when I run the progr=
am?<br>
<br>Thanks once again for your help,<br><br>~Jai!<br><br><div class=3D"gmai=
l_quote">On Thu, Mar 26, 2009 at 3:53 PM, Bill Luebkert <span dir=3D"ltr">&=
lt;<a href=3D"mailto:dbecoll [at] roadrunner.com">dbecoll [at] roadrunner.com</a>>=
</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><=
div class=3D"h5">Perl Help wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
My current DOS background color is white with Black text. I use ANSIColor m=
odule to print error messages in Red color. I use the Color command and I f=
ace two issues:<br>
<br>
1. The Red color error message text thats printed on DOS has black backgrou=
nd, instead of white only.<br>
2. On typing CLS the background color changes to black and text color chang=
es to white.<br>
<br>
What is my Expectation:<br>
1. On prinitng the text in red color should not have the background color b=
lack but use the current DOS background color(White in my case).<br>
<br>
2. On doing CLS on DOS, the dos should maintain its background color(White =
in my case) rather then setting it to default black background color.<br>
<br>
My Code:<br>
use Win32::Console::ANSI;<br>
use Term::ANSIColor;<br>
print color "Bold Red";<br>
print "ERROR_MSG =3D xyz";<br>
print color 'reset';<br>
</blockquote>
<br></div></div>
Seems OK to me on 5.8.8 B820. =A05.001 & 5.006 on the modules, resp.<br=
>
<br>
> p test.pl =A0 =A0 =A0 =A0 =A0 =A0 [switched my FG/BG to reverse (black=
on white) prior to test<br>
Prior to error =A0 =A0 =A0 =A0 =A0[black on white]<br>
ERROR_MSG =3D xyz =A0 =A0 =A0 =A0 [this was red on white]<br>
Done =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0[black on white]<br>
<br>
Everything came out fine as near as I can tell.<br>
<br>
My code:<br>
<br>
use strict;<br>
use warnings;<div class=3D"im"><br>
use Win32::Console::ANSI;<br>
use Term::ANSIColor;<br>
<br></div>
print "Prior to error\n";<br>
print color "Bold Red";<br>
print "ERROR_MSG =3D xyz\n";<br>
print color 'reset';<br>
print "Done\n";<br>
<br>
__END__<br>
<br>
</blockquote></div><br>
--001636284c745285da04661165e5--
--===============1485487120==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1485487120==--
RE: Reset in ANSIColor sets the background to black
This is a multi-part message in MIME format.
--===============0016091931==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C9AEE4.6A03F6EA"
This is a multi-part message in MIME format.
------_=_NextPart_001_01C9AEE4.6A03F6EA
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
Hello
Please try
Thanks
Erich
use strict;
use warnings;
use Win32::Console::ANSI;
use Term::ANSIColor;
use Term::ANSIScreen qw/:color :cursor :screen/;
color 'bold green on blue';
print "\nPrior to error\n";
print colored ("\nThis is an error\n", 'bold red',);
color 'bold green on blue';
print "\nAfter error\n";
__END__
________________________________
From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of Perl
Help
Sent: Thursday, March 26, 2009 11:33 PM
To: Bill Luebkert
Cc: activeperl [at] listserv.activestate.com
Subject: Re: Reset in ANSIColor sets the background to black
Hi Bill,
Thanks for your response. DId you try running CLS command after
executing the code. When I do that, it switches my FG/BG color to
default that is White on Black. More so, my code is not showing the same
results as you described. Is there any other file I need to take care
off? Do you want me to send you the screen shot how it looks like when I
run the program?
Thanks once again for your help,
~Jai!
On Thu, Mar 26, 2009 at 3:53 PM, Bill Luebkert <dbecoll [at] roadrunner.com>
wrote:
Perl Help wrote:
=09
Hi,
=09
My current DOS background color is white with Black
text. I use ANSIColor module to print error messages in Red color. I use
the Color command and I face two issues:
=09
1. The Red color error message text thats printed on DOS
has black background, instead of white only.
2. On typing CLS the background color changes to black
and text color changes to white.
=09
What is my Expectation:
1. On prinitng the text in red color should not have the
background color black but use the current DOS background color(White in
my case).
=09
2. On doing CLS on DOS, the dos should maintain its
background color(White in my case) rather then setting it to default
black background color.
=09
My Code:
use Win32::Console::ANSI;
use Term::ANSIColor;
print color "Bold Red";
print "ERROR_MSG =3D xyz";
print color 'reset';
=09
Seems OK to me on 5.8.8 B820. 5.001 & 5.006 on the modules,
resp.
=09
> p test.pl [switched my FG/BG to reverse (black on
white) prior to test
Prior to error [black on white]
ERROR_MSG =3D xyz [this was red on white]
Done [black on white]
=09
Everything came out fine as near as I can tell.
=09
My code:
=09
use strict;
use warnings;
use Win32::Console::ANSI;
use Term::ANSIColor;
=09
=09
print "Prior to error\n";
print color "Bold Red";
print "ERROR_MSG =3D xyz\n";
print color 'reset';
print "Done\n";
=09
__END__
=09
=09
------_=_NextPart_001_01C9AEE4.6A03F6EA
Content-Type: text/html;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2800.1607" name=3DGENERATOR></HEAD>
<BODY>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN
class=3D390445913-27032009>Hello</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN
class=3D390445913-27032009></SPAN></FONT> </DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN
class=3D390445913-27032009>Please try</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN
class=3D390445913-27032009></SPAN></FONT> </DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN
class=3D390445913-27032009>Thanks</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN
class=3D390445913-27032009>Erich</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff
size=3D2></FONT> </DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2>use strict;<BR>use
warnings;<BR>use Win32::Console::ANSI;<BR>use Term::ANSIColor;<BR>use
Term::ANSIScreen qw/:color :cursor :screen/;<BR>color 'bold green on
blue';<BR>print "\nPrior to error\n";<BR>print colored ("\nThis is an =
error\n",
'bold red',);<BR>color 'bold green on blue';<BR>print "\nAfter
error\n";<BR>__END__<BR></FONT></DIV><BR>
<DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft>
<HR tabIndex=3D-1>
<FONT face=3DTahoma size=3D2><B>From:</B>
activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] <B>On Behalf Of =
</B>Perl
Help<BR><B>Sent:</B> Thursday, March 26, 2009 11:33 PM<BR><B>To:</B> =
Bill
Luebkert<BR><B>Cc:</B> =
activeperl [at] listserv.activestate.com<BR><B>Subject:</B>
Re: Reset in ANSIColor sets the background to black<BR></FONT><BR></DIV>
<DIV></DIV>Hi Bill,<BR><BR>Thanks for your response. DId you try running =
CLS
command after executing the code. When I do that, it switches my FG/BG =
color to
default that is White on Black. More so, my code is not showing the same =
results
as you described. Is there any other file I need to take care off? Do =
you want
me to send you the screen shot how it looks like when I run the
program?<BR><BR>Thanks once again for your help,<BR><BR>~Jai!<BR><BR>
<DIV class=3Dgmail_quote>On Thu, Mar 26, 2009 at 3:53 PM, Bill Luebkert =
<SPAN
dir=3Dltr><<A
href=3D"mailto:dbecoll [at] roadrunner.com">dbecoll [at] roadrunner.co m</A>></SP=
AN>
wrote:<BR>
<BLOCKQUOTE class=3Dgmail_quote
style=3D"PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: =
rgb(204,204,204) 1px solid">
<DIV>
<DIV></DIV>
<DIV class=3Dh5>Perl Help wrote:<BR>
<BLOCKQUOTE class=3Dgmail_quote
style=3D"PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: =
rgb(204,204,204) 1px solid">Hi,<BR><BR>My
current DOS background color is white with Black text. I use =
ANSIColor
module to print error messages in Red color. I use the Color command =
and I
face two issues:<BR><BR>1. The Red color error message text thats =
printed on
DOS has black background, instead of white only.<BR>2. On typing CLS =
the
background color changes to black and text color changes to
white.<BR><BR>What is my Expectation:<BR>1. On prinitng the text in =
red
color should not have the background color black but use the current =
DOS
background color(White in my case).<BR><BR>2. On doing CLS on DOS, =
the dos
should maintain its background color(White in my case) rather then =
setting
it to default black background color.<BR><BR>My Code:<BR>use
Win32::Console::ANSI;<BR>use Term::ANSIColor;<BR>print color "Bold
Red";<BR>print "ERROR_MSG =3D xyz";<BR>print color
'reset';<BR></BLOCKQUOTE><BR></DIV></DIV>Seems OK to me on 5.8.8 B820. =
5.001 & 5.006 on the modules, resp.<BR><BR>> p test.pl =
[switched my FG/BG to reverse =
(black on
white) prior to test<BR>Prior to error
[black on white]<BR>ERROR_MSG =3D xyz =
[this
was red on white]<BR>Done =
[black on white]<BR><BR>Everything came out fine =
as near
as I can tell.<BR><BR>My code:<BR><BR>use strict;<BR>use warnings;
<DIV class=3Dim><BR>use Win32::Console::ANSI;<BR>use
Term::ANSIColor;<BR><BR></DIV>print "Prior to error\n";<BR>print color =
"Bold
Red";<BR>print "ERROR_MSG =3D xyz\n";<BR>print color 'reset';<BR>print =
"Done\n";<BR><BR>__END__<BR><BR></BLOCKQUOTE></DIV><BR></BODY></HTML>
------_=_NextPart_001_01C9AEE4.6A03F6EA--
--===============0016091931==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0016091931==--
Re: Reset in ANSIColor sets the background to black
Perl Help wrote:
> Hi Bill,
>
> Thanks for your response. DId you try running CLS command after
> executing the code. When I do that, it switches my FG/BG color to
> default that is White on Black. More so, my code is not showing the same
> results as you described. Is there any other file I need to take care
> off? Do you want me to send you the screen shot how it looks like when I
> run the program?
OK, my mistake for not stating all. I ran it in a tcsh window rather
than a cmd window. When I try it in a cmd window, I get the same results
as you described. I'm so used to using tcsh rather than cmd, it didn't
even register that I wasn't reproducing the scenario exactly. So it
looks like there is a problem somewhere - maybe there's a workaround,
but I don't know.
You could always switch to tcsh (maybe bash would work too). :)
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Reset in ANSIColor sets the background to black
--===============1930464365==
Content-Type: multipart/alternative; boundary=0016e6476a0205ec0c04661e8224
--0016e6476a0205ec0c04661e8224
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hi,
I tried this code, but it shows the same results in cmd.exe. Also, is there
a way I can read the current background and foreground color of dos window
from perl?
Thanks,
Jai!
On Fri, Mar 27, 2009 at 7:01 AM, Singer, Erich <
Erich.Singer [at] starcompliance.com> wrote:
> Hello
>
> Please try
>
> Thanks
> Erich
>
> use strict;
> use warnings;
> use Win32::Console::ANSI;
> use Term::ANSIColor;
> use Term::ANSIScreen qw/:color :cursor :screen/;
> color 'bold green on blue';
> print "\nPrior to error\n";
> print colored ("\nThis is an error\n", 'bold red',);
> color 'bold green on blue';
> print "\nAfter error\n";
> __END__
>
> ------------------------------
> *From:* activeperl-bounces [at] listserv.ActiveState.com [mailto:
> activeperl-bounces [at] listserv.ActiveState.com] *On Behalf Of *Perl Help
> *Sent:* Thursday, March 26, 2009 11:33 PM
> *To:* Bill Luebkert
> *Cc:* activeperl [at] listserv.activestate.com
> *Subject:* Re: Reset in ANSIColor sets the background to black
>
> Hi Bill,
>
> Thanks for your response. DId you try running CLS command after executing
> the code. When I do that, it switches my FG/BG color to default that is
> White on Black. More so, my code is not showing the same results as you
> described. Is there any other file I need to take care off? Do you want me
> to send you the screen shot how it looks like when I run the program?
>
> Thanks once again for your help,
>
> ~Jai!
>
> On Thu, Mar 26, 2009 at 3:53 PM, Bill Luebkert <dbecoll [at] roadrunner.com>wrote:
>
>> Perl Help wrote:
>>
>>> Hi,
>>>
>>> My current DOS background color is white with Black text. I use ANSIColor
>>> module to print error messages in Red color. I use the Color command and I
>>> face two issues:
>>>
>>> 1. The Red color error message text thats printed on DOS has black
>>> background, instead of white only.
>>> 2. On typing CLS the background color changes to black and text color
>>> changes to white.
>>>
>>> What is my Expectation:
>>> 1. On prinitng the text in red color should not have the background color
>>> black but use the current DOS background color(White in my case).
>>>
>>> 2. On doing CLS on DOS, the dos should maintain its background
>>> color(White in my case) rather then setting it to default black background
>>> color.
>>>
>>> My Code:
>>> use Win32::Console::ANSI;
>>> use Term::ANSIColor;
>>> print color "Bold Red";
>>> print "ERROR_MSG = xyz";
>>> print color 'reset';
>>>
>>
>> Seems OK to me on 5.8.8 B820. 5.001 & 5.006 on the modules, resp.
>>
>> > p test.pl [switched my FG/BG to reverse (black on white)
>> prior to test
>> Prior to error [black on white]
>> ERROR_MSG = xyz [this was red on white]
>> Done [black on white]
>>
>> Everything came out fine as near as I can tell.
>>
>> My code:
>>
>> use strict;
>> use warnings;
>> use Win32::Console::ANSI;
>> use Term::ANSIColor;
>>
>> print "Prior to error\n";
>> print color "Bold Red";
>> print "ERROR_MSG = xyz\n";
>> print color 'reset';
>> print "Done\n";
>>
>> __END__
>>
>>
>
--0016e6476a0205ec0c04661e8224
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi,<br><br>I tried this code, but it shows the same results in cmd.exe. Als=
o, is there a way I can read the current background and foreground color of=
dos window from perl?<br><br>Thanks,<br>Jai!<br><br><div class=3D"gmail_qu=
ote">
On Fri, Mar 27, 2009 at 7:01 AM, Singer, Erich <span dir=3D"ltr"><<a hre=
f=3D"mailto:Erich.Singer [at] starcompliance.com">Erich.Singer [at] st arcompliance.co=
m</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"borde=
r-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-le=
ft: 1ex;">
<div>
<div dir=3D"ltr" align=3D"left"><font size=3D"2" color=3D"#0000ff" face=3D"=
Arial"><span>Hello</span></font></div>
<div dir=3D"ltr" align=3D"left"><font size=3D"2" color=3D"#0000ff" face=3D"=
Arial"><span></span></font>=A0</div>
<div dir=3D"ltr" align=3D"left"><font size=3D"2" color=3D"#0000ff" face=3D"=
Arial"><span>Please try</span></font></div>
<div dir=3D"ltr" align=3D"left"><font size=3D"2" color=3D"#0000ff" face=3D"=
Arial"><span></span></font>=A0</div>
<div dir=3D"ltr" align=3D"left"><font size=3D"2" color=3D"#0000ff" face=3D"=
Arial"><span>Thanks</span></font></div>
<div dir=3D"ltr" align=3D"left"><font size=3D"2" color=3D"#0000ff" face=3D"=
Arial"><span>Erich</span></font></div>
<div dir=3D"ltr" align=3D"left"><font size=3D"2" color=3D"#0000ff" face=3D"=
Arial"></font>=A0</div>
<div dir=3D"ltr" align=3D"left"><font size=3D"2" color=3D"#0000ff" face=3D"=
Arial"><div class=3D"im">use strict;<br>use
warnings;<br>use Win32::Console::ANSI;<br>use Term::ANSIColor;<br></div>use=
Term::ANSIScreen qw/:color :cursor :screen/;<br>color 'bold green on
blue';<br>print "\nPrior to error\n";<br>print colored ("=
;\nThis is an error\n",
'bold red',);<br>color 'bold green on blue';<br>print "=
;\nAfter
error\n";<br>__END__<br></font></div><br>
<div dir=3D"ltr" align=3D"left" lang=3D"en-us">
<hr>
<font size=3D"2" face=3D"Tahoma"><b>From:</b>
<a href=3D"mailto:activeperl-bounces [at] listserv.ActiveState.com" target=3D"_b=
lank">activeperl-bounces [at] listserv.ActiveState.com</a>
[mailto:<a href=3D"mailto:activeperl-bounces [at] listserv.ActiveState.com" targ=
et=3D"_blank">activeperl-bounces [at] listserv.ActiveState.com</a>] <b>On Behalf=
Of </b>Perl
Help<br><b>Sent:</b> Thursday, March 26, 2009 11:33 PM<br><b>To:</b> Bill=
Luebkert<br><b>Cc:</b> <a href=3D"mailto:activeperl [at] listserv.activestate.co=
m" target=3D"_blank">activeperl [at] listserv.activestate.com</a><br><b>Subject:=
</b>
Re: Reset in ANSIColor sets the background to black<br></font><br></div><di=
v><div></div><div class=3D"h5">
<div></div>Hi Bill,<br><br>Thanks for your response. DId you try running CL=
S
command after executing the code. When I do that, it switches my FG/BG colo=
r to
default that is White on Black. More so, my code is not showing the same re=
sults
as you described. Is there any other file I need to take care off? Do you w=
ant
me to send you the screen shot how it looks like when I run the
program?<br><br>Thanks once again for your help,<br><br>~Jai!<br><br>
<div class=3D"gmail_quote">On Thu, Mar 26, 2009 at 3:53 PM, Bill Luebkert <=
span dir=3D"ltr"><<a href=3D"mailto:dbecoll [at] roadrunner.com" target=3D"_b=
lank">dbecoll [at] roadrunner.com</a>></span>
wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div></div>
<div>Perl Help wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204=
, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br><br>My=
current DOS background color is white with Black text. I use ANSIColor=
module to print error messages in Red color. I use the Color command an=
d I
face two issues:<br><br>1. The Red color error message text thats print=
ed on
DOS has black background, instead of white only.<br>2. On typing CLS th=
e
background color changes to black and text color changes to
white.<br><br>What is my Expectation:<br>1. On prinitng the text in red=
color should not have the background color black but use the current DO=
S
background color(White in my case).<br><br>2. On doing CLS on DOS, the =
dos
should maintain its background color(White in my case) rather then sett=
ing
it to default black background color.<br><br>My Code:<br>use
Win32::Console::ANSI;<br>use Term::ANSIColor;<br>print color "Bold=
Red";<br>print "ERROR_MSG =3D xyz";<br>print color
'reset';<br></blockquote><br></div></div>Seems OK to me on 5.8.8 =
B820.
=A05.001 & 5.006 on the modules, resp.<br><br>> p test.pl =A0
=A0 =A0 =A0 =A0 =A0 [switched my FG/BG to reverse (black on
white) prior to test<br>Prior to error =A0 =A0 =A0 =A0
=A0[black on white]<br>ERROR_MSG =3D xyz =A0 =A0 =A0 =A0 [this
was red on white]<br>Done =A0 =A0 =A0 =A0 =A0 =A0 =A0
=A0 =A0 =A0[black on white]<br><br>Everything came out fine as near
as I can tell.<br><br>My code:<br><br>use strict;<br>use warnings;
<div><br>use Win32::Console::ANSI;<br>use
Term::ANSIColor;<br><br></div>print "Prior to error\n";<br>prin=
t color "Bold
Red";<br>print "ERROR_MSG =3D xyz\n";<br>print color '=
reset';<br>print
"Done\n";<br><br>__END__<br><br></blockquote></div><br></div></=
div></div>
</blockquote></div><br>
--0016e6476a0205ec0c04661e8224--
--===============1930464365==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1930464365==--
RE: Reset in ANSIColor sets the background to black
This is a multi-part message in MIME format.
--===============0975741388==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C9AF12.9B06ABE0"
This is a multi-part message in MIME format.
------_=_NextPart_001_01C9AF12.9B06ABE0
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
Hello
I am using ver 5.10.0.
In the example, I ignore the current background and foreground colors (
because I do not know how to get them...) and force a bold green on a
blue background. Error messages should be bold red on a blue background.
I have added the code in bold e.g. system ("cls");
Issue the color changes at the beginning of your program, and this way
you minimize the effect of the cls command, e.g. you do not loose too
much data already displayed on the screen
HTH
Erich
use strict;
use warnings;
use Win32::Console::ANSI;
use Term::ANSIColor;
use Term::ANSIScreen qw/:color :cursor :screen/;
color 'bold green on blue';
system ("cls");
print "\nPrior to error\n";
print colored ("\nThis is an error\n", 'bold red',);
color 'bold green on blue';
print "\nAfter error\n";
__END__
________________________________
From: Perl Help [mailto:perlhelp60 [at] gmail.com]
Sent: Friday, March 27, 2009 3:12 PM
To: Singer, Erich
Cc: Bill Luebkert; activeperl [at] listserv.activestate.com
Subject: Re: Reset in ANSIColor sets the background to black
Hi,
I tried this code, but it shows the same results in cmd.exe. Also, is
there a way I can read the current background and foreground color of
dos window from perl?
Thanks,
Jai!
On Fri, Mar 27, 2009 at 7:01 AM, Singer, Erich
<Erich.Singer [at] starcompliance.com> wrote:
Hello
Please try
Thanks
Erich
=09
use strict;
use warnings;
use Win32::Console::ANSI;
use Term::ANSIColor;
=09
use Term::ANSIScreen qw/:color :cursor :screen/;
color 'bold green on blue';
print "\nPrior to error\n";
print colored ("\nThis is an error\n", 'bold red',);
color 'bold green on blue';
print "\nAfter error\n";
__END__
=09
________________________________
From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of Perl
Help
Sent: Thursday, March 26, 2009 11:33 PM
To: Bill Luebkert
Cc: activeperl [at] listserv.activestate.com
Subject: Re: Reset in ANSIColor sets the background to black
=09
=09
Hi Bill,
=09
Thanks for your response. DId you try running CLS command after
executing the code. When I do that, it switches my FG/BG color to
default that is White on Black. More so, my code is not showing the same
results as you described. Is there any other file I need to take care
off? Do you want me to send you the screen shot how it looks like when I
run the program?
=09
Thanks once again for your help,
=09
~Jai!
=09
=09
On Thu, Mar 26, 2009 at 3:53 PM, Bill Luebkert
<dbecoll [at] roadrunner.com> wrote:
=09
Perl Help wrote:
=09
Hi,
=09
My current DOS background color is white with
Black text. I use ANSIColor module to print error messages in Red color.
I use the Color command and I face two issues:
=09
1. The Red color error message text thats
printed on DOS has black background, instead of white only.
2. On typing CLS the background color changes to
black and text color changes to white.
=09
What is my Expectation:
1. On prinitng the text in red color should not
have the background color black but use the current DOS background
color(White in my case).
=09
2. On doing CLS on DOS, the dos should maintain
its background color(White in my case) rather then setting it to default
black background color.
=09
My Code:
use Win32::Console::ANSI;
use Term::ANSIColor;
print color "Bold Red";
print "ERROR_MSG =3D xyz";
print color 'reset';
=09
Seems OK to me on 5.8.8 B820. 5.001 & 5.006 on the
modules, resp.
=09
> p test.pl [switched my FG/BG to reverse
(black on white) prior to test
Prior to error [black on white]
ERROR_MSG =3D xyz [this was red on white]
Done [black on white]
=09
Everything came out fine as near as I can tell.
=09
My code:
=09
use strict;
use warnings;
use Win32::Console::ANSI;
use Term::ANSIColor;
=09
=09
print "Prior to error\n";
print color "Bold Red";
print "ERROR_MSG =3D xyz\n";
print color 'reset';
print "Done\n";
=09
__END__
=09
=09
------_=_NextPart_001_01C9AF12.9B06ABE0
Content-Type: text/html;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2800.1607" name=3DGENERATOR></HEAD>
<BODY>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff
size=3D2></FONT> </DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN
class=3D390521819-27032009>Hello</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN
class=3D390521819-27032009></SPAN></FONT> </DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN
class=3D390521819-27032009>I am using ver 5.10.0.</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN
class=3D390521819-27032009>In the example, I ignore the current =
background and
foreground colors ( because I do not know how to get them...) and force =
a bold
green on a blue background. Error messages should be bold red on a blue
background.</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN
class=3D390521819-27032009>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN
class=3D390521819-27032009>I have added the code in bold e.g. system =
("cls");
</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN
class=3D390521819-27032009>Issue the color changes at the beginning of =
your
program, and this way you minimize the effect of the cls command, e.g. =
you do
not loose too much data already displayed on the =
screen</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN
class=3D390521819-27032009></SPAN></FONT> </DIV></SPAN></FONT></DIV>=
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN
class=3D390521819-27032009>HTH</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN
class=3D390521819-27032009></SPAN></FONT> </DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN
class=3D390521819-27032009>Erich</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff
size=3D2></FONT> </DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2>use strict;<BR>use
warnings;<BR>use Win32::Console::ANSI;<BR>use Term::ANSIColor;<BR>use
Term::ANSIScreen qw/:color :cursor :screen/;<BR>color 'bold green on
blue';<BR><STRONG><EM>system ("cls");<BR></EM></STRONG>print "\nPrior to =
error\n";<BR>print colored ("\nThis is an error\n", 'bold =
red',);<BR>color 'bold
green on blue';<BR>print "\nAfter error\n";<BR>__END__<BR></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff
size=3D2></FONT> </DIV><BR>
<DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft>
<HR tabIndex=3D-1>
<FONT face=3DTahoma size=3D2><B>From:</B> Perl Help =
[mailto:perlhelp60 [at] gmail.com]
<BR><B>Sent:</B> Friday, March 27, 2009 3:12 PM<BR><B>To:</B> Singer,
Erich<BR><B>Cc:</B> Bill Luebkert;
activeperl [at] listserv.activestate.com<BR><B>Subject:</B> Re: Reset in =
ANSIColor
sets the background to black<BR></FONT><BR></DIV>
<DIV></DIV>Hi,<BR><BR>I tried this code, but it shows the same results =
in
cmd.exe. Also, is there a way I can read the current background and =
foreground
color of dos window from perl?<BR><BR>Thanks,<BR>Jai!<BR><BR>
<DIV class=3Dgmail_quote>On Fri, Mar 27, 2009 at 7:01 AM, Singer, Erich =
<SPAN
dir=3Dltr><<A
href=3D"mailto:Erich.Singer [at] starcompliance.com">Erich.Singer [at] starcomplian=
ce.com</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE class=3Dgmail_quote
style=3D"PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: =
rgb(204,204,204) 1px solid">
<DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff
size=3D2><SPAN>Hello</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff
size=3D2><SPAN></SPAN></FONT> </DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN>Please
try</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff
size=3D2><SPAN></SPAN></FONT> </DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff
size=3D2><SPAN>Thanks</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff
size=3D2><SPAN>Erich</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff
size=3D2></FONT> </DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2>
<DIV class=3Dim>use strict;<BR>use warnings;<BR>use =
Win32::Console::ANSI;<BR>use
Term::ANSIColor;<BR></DIV>use Term::ANSIScreen qw/:color :cursor
:screen/;<BR>color 'bold green on blue';<BR>print "\nPrior to
error\n";<BR>print colored ("\nThis is an error\n", 'bold =
red',);<BR>color
'bold green on blue';<BR>print "\nAfter
error\n";<BR>__END__<BR></FONT></DIV><BR>
<DIV lang=3Den-us dir=3Dltr align=3Dleft>
<HR>
<FONT face=3DTahoma size=3D2><B>From:</B> <A
href=3D"mailto:activeperl-bounces [at] listserv.ActiveState.com"= 20
target=3D_blank>activeperl-bounces [at] listserv.ActiveState.com</A> =
[mailto:<A
href=3D"mailto:activeperl-bounces [at] listserv.ActiveState.com"= 20
target=3D_blank>activeperl-bounces [at] listserv.ActiveState.com</A>] <B>On =
Behalf Of
</B>Perl Help<BR><B>Sent:</B> Thursday, March 26, 2009 11:33 =
PM<BR><B>To:</B>
Bill Luebkert<BR><B>Cc:</B> <A
href=3D"mailto:activeperl [at] listserv.activestate.com"
=
target=3D_blank>activeperl [at] listserv.activestate.com</A><BR><B>Subject:</B=
> Re:
Reset in ANSIColor sets the background to black<BR></FONT><BR></DIV>
<DIV>
<DIV></DIV>
<DIV class=3Dh5>
<DIV></DIV>Hi Bill,<BR><BR>Thanks for your response. DId you try =
running CLS
command after executing the code. When I do that, it switches my FG/BG =
color
to default that is White on Black. More so, my code is not showing the =
same
results as you described. Is there any other file I need to take care =
off? Do
you want me to send you the screen shot how it looks like when I run =
the
program?<BR><BR>Thanks once again for your help,<BR><BR>~Jai!<BR><BR>
<DIV class=3Dgmail_quote>On Thu, Mar 26, 2009 at 3:53 PM, Bill =
Luebkert <SPAN
dir=3Dltr><<A href=3D"mailto:dbecoll [at] roadrunner.com"
target=3D_blank>dbecoll [at] roadrunner.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE class=3Dgmail_quote
style=3D"PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: =
rgb(204,204,204) 1px solid">
<DIV>
<DIV></DIV>
<DIV>Perl Help wrote:<BR>
<BLOCKQUOTE class=3Dgmail_quote
style=3D"PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: =
rgb(204,204,204) 1px solid">Hi,<BR><BR>My
current DOS background color is white with Black text. I use =
ANSIColor
module to print error messages in Red color. I use the Color =
command and I
face two issues:<BR><BR>1. The Red color error message text thats =
printed
on DOS has black background, instead of white only.<BR>2. On =
typing CLS
the background color changes to black and text color changes to
white.<BR><BR>What is my Expectation:<BR>1. On prinitng the text =
in red
color should not have the background color black but use the =
current DOS
background color(White in my case).<BR><BR>2. On doing CLS on DOS, =
the dos
should maintain its background color(White in my case) rather then =
setting
it to default black background color.<BR><BR>My Code:<BR>use
Win32::Console::ANSI;<BR>use Term::ANSIColor;<BR>print color "Bold =
Red";<BR>print "ERROR_MSG =3D xyz";<BR>print color
'reset';<BR></BLOCKQUOTE><BR></DIV></DIV>Seems OK to me on 5.8.8 =
B820.
5.001 & 5.006 on the modules, resp.<BR><BR>> p test.pl =
[switched my FG/BG to reverse =
(black on
white) prior to test<BR>Prior to error
[black on white]<BR>ERROR_MSG =3D xyz =
[this
was red on white]<BR>Done =
[black on white]<BR><BR>Everything came out fine =
as near
as I can tell.<BR><BR>My code:<BR><BR>use strict;<BR>use warnings;
<DIV><BR>use Win32::Console::ANSI;<BR>use
Term::ANSIColor;<BR><BR></DIV>print "Prior to error\n";<BR>print =
color "Bold
Red";<BR>print "ERROR_MSG =3D xyz\n";<BR>print color =
'reset';<BR>print
=
"Done\n";<BR><BR>__END__<BR><BR></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV>=
</BLOCKQUOTE></DIV><BR></BODY></HTML>
------_=_NextPart_001_01C9AF12.9B06ABE0--
--===============0975741388==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0975741388==--
Re: Reset in ANSIColor sets the background to black
Perl Help wrote:
> Hi,
>
> I tried this code, but it shows the same results in cmd.exe. Also, is
> there a way I can read the current background and foreground color of
> dos window from perl?
Not sure if it's in a module, but you can use Win32::API to get it from
GetConsoleScreenBufferInfo function.
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Reset in ANSIColor sets the background to black
The following code gets the DOS current background and foreground
color information and prints the error message in red color and then
sets the text color back to original without changing its background
color.
use strict;
use warnings;
use Win32::Console;
my $console = Win32::Console->new(STD_OUTPUT_HANDLE);
my $CurrentConsoleColor = $console->Attr;
my $BackgroundColor = $CurrentConsoleColor &
(BACKGROUND_RED|BACKGROUND_BLUE|BACKGROUND_GREEN|BACKGROUND_ INTENSITY);
print "\nPrior to error: \n";
# This sets the text color on DOS in red with intensity
$console->Attr(FOREGROUND_RED|FOREGROUND_INTENSITY|$Backgrou ndColor);
print "\nError Msg: xyz \n";
$console->Attr($CurrentConsoleColor);
print "\nAfter error\n";
Thanks,
Jai!
On 3/27/09, Bill Luebkert <dbecoll [at] roadrunner.com> wrote:
> Perl Help wrote:
>> Hi,
>>
>> I tried this code, but it shows the same results in cmd.exe. Also, is
>> there a way I can read the current background and foreground color of
>> dos window from perl?
>
> Not sure if it's in a module, but you can use Win32::API to get it from
> GetConsoleScreenBufferInfo function.
>
>
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Reset in ANSIColor sets the background to black
Good Morning
Thanks for posting your solution
Erich
-----Original Message-----
From: Perl Help [mailto:perlhelp60 [at] gmail.com]
Sent: Saturday, March 28, 2009 3:31 PM
To: Bill Luebkert; Singer, Erich
Cc: activeperl [at] listserv.activestate.com
Subject: Re: Reset in ANSIColor sets the background to black
The following code gets the DOS current background and foreground color
information and prints the error message in red color and then sets the
text color back to original without changing its background color.
use strict;
use warnings;
use Win32::Console;
my $console = Win32::Console->new(STD_OUTPUT_HANDLE);
my $CurrentConsoleColor = $console->Attr; my $BackgroundColor =
$CurrentConsoleColor &
(BACKGROUND_RED|BACKGROUND_BLUE|BACKGROUND_GREEN|BACKGROUND_ INTENSITY);
print "\nPrior to error: \n";
# This sets the text color on DOS in red with intensity
$console->Attr(FOREGROUND_RED|FOREGROUND_INTENSITY|$Backgrou ndColor);
print "\nError Msg: xyz \n";
$console->Attr($CurrentConsoleColor);
print "\nAfter error\n";
Thanks,
Jai!
On 3/27/09, Bill Luebkert <dbecoll [at] roadrunner.com> wrote:
> Perl Help wrote:
>> Hi,
>>
>> I tried this code, but it shows the same results in cmd.exe. Also, is
>> there a way I can read the current background and foreground color of
>> dos window from perl?
>
> Not sure if it's in a module, but you can use Win32::API to get it
> from GetConsoleScreenBufferInfo function.
>
>
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs