Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I am trying to understand this.
$ perl -MFile::Find -e 'print $File::Find::VERSION'
I don't understand the following:

1. Why do you have to put a '$' in front of the File::Find::VERSION?
2. What does '::' in between Find and VERSION mean? Does it simply mean, get the File::Find variable named 'VERSION'?

Replies are listed 'Best First'.
Re: Printing Module Version
by toolic (Bishop) on Aug 29, 2011 at 18:06 UTC
    This syntax is all described in Packages.
Re: Printing Module Version
by Your Mother (Archbishop) on Aug 29, 2011 at 18:14 UTC

    FWIW, I find this version, ho-ho, more familiar:

    perl -MFile::Find -le 'print File::Find->VERSION'

    There is also pmvers

    pmvers File::Find

      And don't forget V! I use it on a daily basis, multiple times a day

      $ perl -MV=File::Find File::Find /pro/lib/perl5/5.14.1/File/Find.pm: 1.19 $ perl -MV=DBI,Text::CSV_XS DBI /pro/lib/perl5/site_perl/5.14.1/x86_64-linux-ld/DBI.pm: 1.616 Text::CSV_XS /pro/lib/perl5/site_perl/5.14.1/x86_64-linux-ld/Text/CSV_XS.pm +: 0.83 $

      Enjoy, Have FUN! H.Merijn
Re: Printing Module Version
by Anonymous Monk on Aug 30, 2011 at 00:30 UTC
    In short,  VERSION is a scalar in the File::Find namespace. Hence the use of $ and ::

    If that doesn't clear it up, you really need to read some basic documentation such as toolic pointed you to.