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

Hi, I'm receiving a warning message when using the Unicode::Map() module.
the message displayed looks like this:
Bad string size! at path/to/file/Unicode/Map.pm line 359
It starts to pump these messages out onto my screen. Does anyone know how I can disable this print statement?
I tried searching for this print statement but couldn't find it. I did a grep for it and grep found it in the map.dll. Does anyone have any advice?

Replies are listed 'Best First'.
Re: how to turn off warning message
by GrandFather (Saint) on Nov 07, 2008 at 01:25 UTC

    Can you reproduce the problem with a small sample script? In doing so you will either produce a sample to use in a bug report, or a sample that we can examine and advise on or you may discover a problem in your code and fix it. Probably better to show us the sample before you report a bug though.


    Perl reduces RSI - it saves typing
      the code is pretty straight forward.
      my $map = new Unicode::Map("ISO-8859-1");
      $text = $map->from_unicode($text);
      the text I keep sending in returns the error message.
Re: how to turn off warning message
by Anonymous Monk on Nov 07, 2008 at 07:25 UTC
    Don't use #!/usr/bin/perl -w, instead use warnings;
      To expand on anonymonk's accurate but terse comment.

      Both -w> and <c>use warnings; turn on the warnings diagnostics, it's a matter of scope.

      use warnings; turns on warnings-checking in the file containing the statement (local scope). -w set warnings for your file and any used modules (global scope).

      You usually (probably) want use warnngs; routinely.

      ----
      I Go Back to Sleep, Now.

      OGB