<div dir="ltr"><div class="gmail_quote">On Thu, Sep 8, 2011 at 11:15 AM, Gabor Szabo <span dir="ltr"><<a href="mailto:szabgab@gmail.com">szabgab@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
order of switches? </blockquote><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
try<br>
<br>
perl -MCwd -e "print Cwd::getcwd();"<br></blockquote><div><br>Indeed that is the problem.<br><br>-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".<br>
<br>If you were to add strictures, you would get a warning.<br><br>$ perl -Mstrict -W -e -MCwd<br>Useless use of negation (-) in void context at -e line 1.<br><br>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 would cease.<br>
<br>$ perl -Mstrict -W -e "print -MCwd"<br>-MCwd<br><br>The value of negating MCwd is .. -MCwd. :)<br></div></div></div>