Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 :)

like image 770
David B Avatar asked Oct 22 '10 18:10

David B


1 Answers

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.

like image 124
Eric Strom Avatar answered Nov 10 '22 09:11

Eric Strom