It's all working, but it's working like this:
<pseudocode> output headers; output top of page; print '<ul>'; while fetchrow_hashref{ print '<li> stuff </li>'; } print '</ul>'; </pseudocode>
So would it be better to do this:
<pseudocode> output headers; output top of page; $list = '<ul>'; while fetchrow_hashref{ $list .= '<li> stuff </li>'; } $list .= '</ul>'; print $list; </pseudocode>
That is, to assemble big-ass string variables and dump them in their entirety in one print statement?
And I know what you're going to say, I should use HTML::Template. I will -- but the question above prompts me to say that using HTML::Template, you're pretty much only doing that second version i.e. all the page assembly happens, then the print, in HTML::Template -- right?
If I'm conscious of the users sitting looking at a blank page for a while, my instinct is to unbuffer output and do it more like the while() version above.
That way they get a sense of progress, even if it's slow.
Is the efficiency of 'assemble, then print' so much greater than 'print while'?
I'd be interested in your thoughts.
($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss') =~y~b-v~a-z~s; print
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |