Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Question about oddities when printing a tab

by LanX (Saint)
on Jan 04, 2013 at 06:35 UTC ( [id://1011564]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Question about oddities when printing a tab
in thread Question about oddities when printing a tab

> By the way, I am posting my output by copying/pasting from terminal window. Is that the wrong way to do it?

no thats what I'm doing, and it works on my linux box. but now it's evident that Term::ANSIColor tries to translate tabs to blanks.

lanx@nc10-ubuntu:~$ 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] ^blanks^

Seems like in your environment the translation is broken.

Your solution works now, because you transfered the tabs out of colored().

Anyway this only works reliably as long as your "server" names all have the same length. Do you really have less than 10? ;-)

Cheers Rolf

Replies are listed 'Best First'.
Re^4: Question about oddities when printing a tab
by walkingthecow (Friar) on Jan 04, 2013 at 06:39 UTC
    The server names actually do all have the same length, though there are far more than 10. However, the naming convention is not SERVERX, I just used that for my example ;)

    My environment is Solaris 9 with Perl 5.8, so that may be part of the issue as well. But, everything is working now. I appreciate your help!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1011564]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-24 18:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found