in reply to Remove whitespace in string and maintain overall length

Use tr to squelch the spaces; and the return value plus a little math to pad to the required length:

$s = 'fred bill john';; $s .= ' 'x ( 37 - length( $s ) + $s =~ tr[ ][]s ); print "'$s'";; 'fred bill john '

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.