[Israel.pm] losing my sanity?
xsawyerx at gmail.com
Thu Sep 8 01:22:23 PDT 2011
On Thu, Sep 8, 2011 at 11:15 AM, Gabor Szabo <szabgab at gmail.com> wrote:
> order of switches?
> perl -MCwd -e "print Cwd::getcwd();"
Indeed that is the problem.
-e expects the next string to be something to run. When you write "-e
-MCwd", you're actually asking the perl interpreter to run the Perl code
"-MCwd", which results in.. nothing. "-" is used for negation, and that line
of "code" is basically negating "MCwd".
If you were to add strictures, you would get a warning.
$ perl -Mstrict -W -e -MCwd
Useless use of negation (-) in void context at -e line 1.
The reason this gets you a warning is because you're not doing anything with
the value you got from the operation. If you were to use it, the warning
$ perl -Mstrict -W -e "print -MCwd"
The value of negating MCwd is .. -MCwd. :)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Perl