<?xml version="1.0" encoding="windows-1252"?>
<node id="512016" title="Re: Compiling Smart::Comments with &quot;-Wc&quot;" created="2005-11-27 07:55:31" updated="2005-11-27 02:55:31">
<type id="11">
note</type>
<author id="125487">
jarich</author>
<data>
<field name="doctext">
Perl is case sensitive.  Thus writing:
&lt;code&gt;
perl -Wc mycode.pl
&lt;/code&gt;
is not the same as writing:
&lt;code&gt;
perl -wc mycode.pl
&lt;/code&gt;
&lt;p&gt;
The latter (with the small &lt;code&gt;w&lt;/code&gt;) says turn on warnings for your code.  The former says turn on warnings even if parts of the code use &lt;code&gt;no warnings&lt;/code&gt; or some other construct to turn off warnings.
&lt;/p&gt;
&lt;p&gt;
Chances are that you don't really want to be using &lt;code&gt;-W&lt;/code&gt; almost ever when compiling your code.  But you do want to use &lt;code&gt;-w&lt;/code&gt;.
&lt;/p&gt;
&lt;p&gt;
An important thing to know is that that error message &lt;i&gt;has nothing to do with your code&lt;/i&gt;.  Your current document isn't being replaced.  What is happening is the following:
&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;perl parses your code for &lt;code&gt;use&lt;/code&gt; lines and
        similar directives.
    &lt;/li&gt;
    &lt;li&gt;perl then finds the code for the module you're using (ie Smart::Comments) then parses and compiles that code.  If that code generates any warnings or compilation errors perl tells you about them.
    &lt;/li&gt;
    &lt;li&gt;After all of your modules are compiled and loaded perl compiles the rest of your program.  If there are any warnings or compilation errors you'll hear about them now.
    &lt;/li&gt;
    &lt;li&gt;perl then executes your code.
    &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
The error you're seeing is being generated in step 2.  Something in Smart::Comments' dependancies results in UNIVERSAL::VERSION being defined more than once.  This may or may not be a bug.  If it's done inside an area which explicitly turns warnings &lt;i&gt;off&lt;/i&gt; then generally you won't see this warning.  Unless you use &lt;code&gt;-W&lt;/code&gt; rather than &lt;code&gt;-w&lt;/code&gt;.
&lt;/p&gt;
&lt;p&gt;
Basic summary: do your compile checks with &lt;code&gt;-wc&lt;/code&gt; rather than &lt;code&gt;-Wc&lt;/code&gt; (this isn't C), because generally module authors usually turn off warnings only when they really mean it.
&lt;/p&gt;
&lt;p&gt;
Hope this helps
&lt;/p&gt;
jarich</field>
<field name="root_node">
512005</field>
<field name="parent_node">
512005</field>
</data>
</node>
