in reply to Re: Question about oddities when printing a tab
in thread Question about oddities when printing a tab
That is my code exactly, minus shebang and use strict/warnings. I just did that simple bit of code to see if I could reproduce the issue, and it did.
Actually, just tested your code and output was as expected. I had done it earlier without Term::ANSIColor and they were not aligned, but now they are. Adding Term::ANSIColor back in and the output is out of line again. So it does seem to have something to do with Term::ANSIColor, now I just need to figure out what.
Thanks for your help!
My Code:#!/usr/bin/perl use strict; use warnings; use Term::ANSIColor; my @systems=qw(SERVER1 SERVER2 SERVER3); foreach my $system (@systems) { print "Now powering on $system:"; print color 'bold red'; print " \t\t[DONE]\n"; print color 'reset'; } _END_ Now powering on SERVER1: [DONE] Now powering on SERVER2: [DONE] Now powering on SERVER3: [DONE]
By the way, I am posting my output by copying/pasting from terminal window. Is that the wrong way to do it?
UPDATE
Changed my code as follows and now output is as expected. Sorry for such a stupid question...
#!/usr/bin/perl use strict; use warnings; use Term::ANSIColor; my @systems=qw(SERVER1 SERVER2 SERVER3); foreach my $system (@systems) { print "Now powering on $system:"; print "\t\t".colored("[DONE]", 'bold red')."\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Question about oddities when printing a tab
by LanX (Saint) on Jan 04, 2013 at 06:35 UTC | |
by walkingthecow (Friar) on Jan 04, 2013 at 06:39 UTC |