- or download this
$padded = sprintf("%${pad_len}s", $text);
- or download this
$padded = sprintf("%04d", $text);
- or download this
#!/usr/bin/perl -w
use strict;
...
my $padded2 = sprintf("%${pad_len}s", $string2);
print "|$padded1|\n|$padded2|\n";
- or download this
| 12345|
|1234567890|