I've read that it's considered good practice to always include a
Only modules, and only those pushed to CPAN really benefit from specifying
$VERSION. There's not much use for it in a script except to use a familiar name rather than inventing a new one if you want the script's version to be accessible.
CPAN uses it as the version of the distribution, allowing it to index different versions of the same distribution.
cpanm uses it to check if an installed module is of sufficiently high level to meet the required minimum version of a dependency.
As brian d foy mentioned, it can also be checked by
use Foo 1.23;, but most people avoid this in favour of specifying the required versions of dependencies in their distribution's META file. This allows
cpanm to update the dependency if needed (where use using
use Foo 1.23; would cause the installation to fail during testing). Due to the lack of use of the feature, it's hardly a primary use.