Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Perl is case sensitive. Thus writing:
perl -Wc
is not the same as writing:
perl -wc

The latter (with the small w) says turn on warnings for your code. The former says turn on warnings even if parts of the code use no warnings or some other construct to turn off warnings.

Chances are that you don't really want to be using -W almost ever when compiling your code. But you do want to use -w.

An important thing to know is that that error message has nothing to do with your code. Your current document isn't being replaced. What is happening is the following:

  1. perl parses your code for use lines and similar directives.
  2. 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.
  3. 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.
  4. perl then executes your code.

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 off then generally you won't see this warning. Unless you use -W rather than -w.

Basic summary: do your compile checks with -wc rather than -Wc (this isn't C), because generally module authors usually turn off warnings only when they really mean it.

Hope this helps


In reply to Re: Compiling Smart::Comments with "-Wc" by jarich
in thread Compiling Smart::Comments with "-Wc" by neversaint

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (2)
    As of 2018-03-25 02:19 GMT
    Find Nodes?
      Voting Booth?
      When I think of a mole I think of:

      Results (299 votes). Check out past polls.