in reply to Re: Padding strings for a flat file
in thread Padding strings for a flat file
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;
|
|---|