sprintf#
Format a string POSIX-style, identical to built-in sprintf.
Σύνοψη#
use POSIX qw(sprintf);
my $line = sprintf("%-10s %6.2f", $name, $price);
Τι επιστρέφεται#
A single scalar holding the formatted string. Conversion specifiers, flags, width, precision, and length modifiers are whatever your built-in sprintf supports.
Οριακές περιπτώσεις#
Called with no arguments: croaks with
Usage: POSIX::sprintf(pattern, args...).Too few arguments for the format: unfilled specifiers expand to the empty string, matching the core
sprintf.
Διαφορές από το upstream#
Fully compatible with upstream POSIX.