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";
In reply to Re: fixed length string
by muntfish
in thread fixed length string
by shilpam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |