On 07/07/05 22:58 +0200, Rachwal Waldemar-AWR001 wrote:
> I am looking for a YAML parser/filter that keeps arrangement of original
> input data intact except those parts one wants to change. The idea behind
> this need is that I have YAML configuration files prepared by a human and
> want to update/change partial data in these files by the program while
> retaining original shape of the document.
> I believe it was possible with use of nice perl XML::Twig module, but I'd
> want to forget about XML definitely, at least in such things like
> configuration. Obviously I will not forget about perl (esp. Perl6/Parrot
> look so promising), however I haven't found on CPAN what I wanted, or... I
> was not so much persistent?
I assume you are a Perl user. If you look in the YAML-0.35 distribution from
CPAN there are some sample scripts. One of them turns palm pilot contacts into
YAML, and uses techniques to pretty print the key order.
YAML.pm supports a "shadowing" technique that can preserve key order in a
parallel data structure.
Hope that helps.