Now with the use of Perl + templates how the same thing is suppose to work?

You retrieve the previous counter value, increment it, and store it again. Then you pass the new counter value to the template engine, let it render the template, and print the result.

Perl 6 - links to (nearly) everything that is Perl 6.

In reply to Re: From php to perl + template solution by moritz
in thread From php to perl + template solution by Nik

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":