VOOZH about

URL: https://www.geeksforgeeks.org/perl/perl-sprintf-function/

⇱ Perl | sprintf() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Perl | sprintf() Function

Last Updated : 11 Jul, 2025
sprintf() function in Perl uses Format provided by the user to return the formatted string with the use of the values in the list. This function is identical to printf but it returns the formatted string instead of printing it.
Syntax: sprintf Format, List Returns: a formatted scalar string
Example 1:
Output:
 Geeks
Geeks 
Example 2:
Output:
007
123
0123
Comment
Article Tags:

Explore