Now:sub pad { my $char = pop; my $max = pop; $char = " " unless defined $char; $_[0] .= $char x ($max - length $_[0]); }
pad($v, 30, 'x'); # $v is now 30 characters long print $v;
In reply to Re: Padding strings for a flat file
by Dominus
in thread Padding strings for a flat file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |