I am learning Writing CGI Application with Perl — Kevin Meltzer . Brent Michalski
Scripts in the book mostly begin with this:
#!"c:\strawberry\perl\bin\perl.exe" -wT
# sales.cgi
$|=1;
use strict;
use lib qw(.);
What’s the line $|=1; How to space it, eg. $| = 1; or $ |= 1; ?
Why put use strict; after $|=1; ?
Thanks
perlvar is your friend. It documents all these cryptic special variables.
$OUTPUT_AUTOFLUSH (aka $|):
Happy coding.
For the other questions:
There is no reason that
use strict;comes after$|, except by the programmers convention.$|and other special variables are not affected by strict in this way. The spacing is also not important — just pick your convention and be consistent. (I prefer spaces.)