I’m very much a novice — familiar with Learning Perl but finding Intermediate
Perl an uphill slog.
The few lines below are from a subroutine that calls Template Toolkit. The
commented out line I simply copied from Perl Template Toolkit (PTT); the line
after it is what I replaced it with after seeing Perl Best Practices (PBP) show
the auto flush variable handled this way. Both lines work, though I worry that
the first one may not always work or else the use of local would not be
recommended.
I vaguely understand that local restricts the auto flushing, though I’m not
sure how. Does local go out of scope when the TT is called? More broadly, do I
actually need local? Do I actually need auto flushing? The authors of PTT and
PBP assumed that persons reading their books would be fairly accomplished
programmers — but I’m not. So can you educate me?
# $| = 1;
local $| = 1; # autoflush output
print "Content-Type: text/html\n\n";
my $tt = Template->new(
ect.
Many thanks!
Rick Triplett
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/