How to get rid of 'Name ... used only once: possible typo at ...'?

David B picture David B · Oct 22, 2010 · Viewed 8.5k times · Source
use YAML::XS;
local $YAML::XS::DumpCode=1;
...

I get the warning:

Name "YAML::XS::DumpCode" used only once: possible typo at ..

Well, I know I can suppress this specific warning, but it's kind'a ugly. Am I doing anything wrong? I'm not used to be warned :)

Answer

Eric Strom picture Eric Strom · Oct 22, 2010

It seems like $YAML::XS::DumpCode is only used from C code, and it is never initialized in YAML/XS.pm (it is there, but commented out). So that might be a bug to submit against that module.

In the mean time, no warnings 'once'; should do the trick.