laziness, impatience, and hubris | |
PerlMonks |
Re: A Set String Lengthby ase (Monk) |
on Jul 27, 2000 at 14:08 UTC ( [id://24651]=note: print w/replies, xml ) | Need Help?? |
I actually did $string .= " " x ($width-length($string)); in a script today - D'oh! Didn't even think about /printf | substr | unpack/ As it turned out, 'funny' things happen when <code>($width-length($s)<0</code)> so either you need to test for that (as I ended up doing) or do it another way -pack seems to be the best tool for what I'm doing -thanks for the fresh view.
-ase
In Section
Seekers of Perl Wisdom
|
|