Not just that. It's also to allow the bare 1; at the end of modules to make it end in a true value, without a complaint under perl -c Foo.pm.
Note that no true value at the end of a module, whatever you choose, causes a complaint under normal cicrumstances, actually because a module is loaded in scalar context.
As a test: I saved this little module as "Temp.pm" in the current directory:
# Temp.pm
package Temp;
printf "Context = %s\n", defined wantarray ? 0+wantarray : 'undef';
# true value, but may cause warning:
"nothing";
This command line makes it work without warning:
perl -lib=. -MTemp -we1
Result:
Context = 0
But with perl -wc, you do get a warning:
perl -wc Temp.pm
Useless use of a constant in void context at Temp.pm line 3.
Temp.pm syntax OK
Replace the string "nothing" with 1, and you're fine:
Temp.pm syntax OK
|