qw() is a fancy way of writing an empty list. Executing () will be two characters shorter.
Passing an empty list to use is important to avoid importing. From the use documentation :
If you do not want to invoke a package import method (for example, to stop a namespace change), specify an empty list
eg. By default, the Cwd module exports getcwd . This does not happen if we give it an empty list:
use strict; use Cwd; print "I am here: ", getcwd, "\n";
works but
use strict; use Cwd (); print "I am here: ", getcwd, "\n";
aborts compilation with Bareword "getcwd" not allowed while "strict subs" in use .
source share