in reply to Minimum width in printf() ignored?
Are you sure the code you posted is exactly the same as the code you are running? And that your script is actually executing the sprintf you exhibited?
My attempt at a SSCE is
my $last_n = 'E6/11/C#';
my $n = 'E6/11/Db';
sub notenames { return 'unknown' }
print "Perl $^V\n";
my $out = sprintf("Two names: '%-16s', '%-16s' for ", $last_n, $n);
print $out . " " . ¬enames($k) . "\n";
with the indented lines cut-and-pasted from your post. I have run this under Perls 5.40.0 and 5.10.1 and gotten
Perl v5.40.0 Two names: 'E6/11/C# ', 'E6/11/Db ' for unknown
and
Perl v5.10.1 Two names: 'E6/11/C# ', 'E6/11/Db ' for unknown
respectively.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Minimum width in printf() ignored?
by Miq19 (Novice) on Sep 01, 2024 at 16:01 UTC | |
by Anonymous Monk on Sep 02, 2024 at 15:20 UTC |