I'm basing the majority on my Perl scripts on the following template/skeleton:
#!/usr/bin/perl -w
use strict;
use utf8;
$| = 1;
binmode(STDOUT, ":utf8");
# my code goes here.
The things achieved by this template:
- Enable warnings (
-w
) - Enabling strict mode (
use strict
) - Going pure UTF-8 (
use utf8
+binmode(STDOUT, ":utf8")
) - Disable buffering (
$| = 1
)
My question is:
How can my template be improved to better reflect Perl best-practices?