Click here to get back home

printf + escape code

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
printf + escape code aequites 05-22-2008
Posted by aequites on May 22, 2008, 12:36 am
Please log in for more thread options
Could someone help to explain why the second column is not formatted
with the correct width when escape codes are used?

$ perl -e 'printf ":%-20s:%-20s:\n", "string1", "\e[32mstring2\e[m"'
:string1 :string2 :


Similar ThreadsPosted
Re: printf doesn't do right justify March 9, 2008, 8:32 am
printf doesn't do right justify March 9, 2008, 8:04 am
printf and variable length? October 25, 2005, 10:03 am
Using printf to modify scalars May 19, 2006, 8:44 am
printf: zero pad after the decimal a given amount March 30, 2008, 4:09 pm
Can't find right printf format April 28, 2008, 1:45 pm
perl win32 & output of printf November 5, 2004, 4:15 pm
To store the output of printf into a variable... April 3, 2005, 9:56 am
escape whitespace in qw/ / November 25, 2004, 8:41 am
How to expand escape sequence (e.g. \n)? September 11, 2004, 4:24 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap