I am learning Writing CGI Application with Perl -- Kevin Meltzer . Brent Michalski
Scripts in the book mostly begin with this:
#!\"c:\\strawberry\\perl\\
$| = 1;
forces a flush after every write or print, so the output appears as soon as it's generated rather than being buffered.
See the perlvar documentation.
$|
is the name of a special variable. You shouldn't introduce a space between the $
and the |
.
Whether you use whitespace around the =
or not doesn't matter to Perl. Personally I think using spaces makes the code more readable.
Why the use strict;
comes after $| = 1;
in your script I don't know, except that they're both the sort of thing you'd put right at the top, and you have to put them in one order or the other. I don't think it matters which comes first.