in reply to YAML::XS Load/LoadFile error

It's not YAML::XS signaling an error in the YAML, it's Perl signaling an error in YAML::XS.

What version of YAML::XS are you using? Try upgrading it, for starters.

Replies are listed 'Best First'.
Re^2: YAML::XS Load/LoadFile error
by halfcountplus (Hermit) on Oct 20, 2010 at 03:22 UTC

    Yeah, I follow this is a problem in the module, not my code or the data structure, which is why I'm curious. This is the "latest", YAML::XS 0.34.

    Line 70 just calls YAML::XS::LibYAML, which is the C executable.

    Like I said, it would not take me long to do this by hand or another way -- JSON, XML, Storable, it doesn't matter -- just this seems excessively pathetic...

      Bugs are annoying, but pathetic? That's an odd characterisation, especially considering we have no idea what the bug is.

      Line 262 is a blank line. It's surely coming from what I see as line 265:

      /* Get each key string and value node and put them in the hash */ while ((key_node = load_node(loader))) { assert(SvPOK(key_node)); <--------------- value_node = load_node(loader); hv_store_ent( hash, key_node, value_node, 0 ); }

      It's expecting load_node to return a scalar already containing a string, but a check finds it doesn't. What does that mean exactly? The module's author could probably tell you faster than I could.

        Hmph. Made me wonder if 'undef' hash keys could be an issue but they test fine. Maybe I'll inquire. I have used this somewhat before, it always seemed simple and trouble free.