The problem with your
print '\n'; was not that it wasn't
printf() but that it used single quotes, where no interpolation was done - i.e. Perl interpreted the slash-n literally, and printed out a slash-n to your browser. If you were to use
print "\n"; it would work as you wanted.
Generally speaking printf is used only if you want to do some kind of formatting, for instance:
Code:
printf("%.4d", $count);
Will pad the variable out to have a width of 4 characters, and it will be preceded with 0's, i.e.
Code:
$count = 4;
printf("%.4d", $count);
# prints out 0004
$count = 3489;
printf("%.4d", $count);
#prints out 3489
Hope that helps.