in reply to fixed length string
Perl doesn't have a data type with that behaviour, but you could try something like:
use strict; my ($len, $str) = (5, "someword"); $str = sprintf "%-${len}.${len}s", $str; print ">>$str<<\n"; [download]