Don't mind the downvotes Stef, it's a perfectly reasonable question for a new Perl user.
I see that the question has been suitably answered, but I thought I'd elaborate a little more on *how* it was answered. There is a command-line tool called "perldoc" which is invaluable to Perl coders. It is roughly equivalent to "man" in the unix world. If you want to know how to use a module (probably downloaded from CPAN), you can type perldoc Module::Name, replacing "Module::Name" with the actual name of the module.
Perldoc also has a feature that describes built-in functions in Perl, such as printf and sprintf. You can access this by typing perldoc -f function_name, again replacing "function_name" with the actual function. With this tool, you wouldn't have had to wait for a reply from perlmonks. :)
For more information on "perldoc", simply type perldoc perldoc. Enjoy! | [reply] [d/l] [select] |
| [reply] |
Very nice, thank you for the link!
| [reply] |
printf(...) is equivalent to print sprintf(...)
You'd use sprintf when you need to have a formatted string in memory, and printf when you want to output a formatted string.
| [reply] [d/l] [select] |
The sprintf manual page says it pretty clearly. | [reply] |