Perl Home
PERL Functions
© 2011 TutorialsPoint.COM
|
PERL sprintf Function
Syntax
Definition and Usage
The sprintf function uses FORMAT to return a formatted string based on the values in LIST. Essentially identical to printf, but the formatted string is returned instead of being printed.
Return Value
Example
Try out following example:
#!/usr/bin/perl -w
$text = sprintf("%0d \n", 9);
print "Formated string $text\n";
|
It will produce following result:
|

|
|
|