in reply to UTF8 with YAML or JSON

When using a YAML module, always use YAML qw/LoadFile DumpFile/; will allow you to get the structure without writing a loop to get the lines into a scalar.

--linuxkid


imrunningoutofideas.co.cc

Replies are listed 'Best First'.
Re^2: UTF8 with YAML or JSON
by SBECK (Chaplain) on Jun 29, 2012 at 18:10 UTC

    In this case, the sample code I post is exactly like in the module... the YAML is stored in the __DATA__ section, so LoadFile/DumpFile aren't the routines I want (and Load/Dump are automatically exported, so there's no need to do that.

    That way, I don't have to play games determining where data files live, how they should be installed, etc.