in reply to Self-printing program

Surprisingly, no one has actually answered your question.

The program is a single printf, taking $body as the format string, and three arguments, which will be substituted in for the %c, %s, and %c in the format string. 34 formatted as a char (%c) is a single quote. $body, as you should see, is defined as a string, before the printf.

So the printf will print everything in $body up to the %c, then a single quote, then the entire text of $body, then the other single quote, then everything after the final %c.


The PerlMonk tr/// Advocate