From: Makoto K. <kw...@ku...> - 2008-04-10 17:01:32
|
Hi, I'm trying YAML::XS which is a binding of LibYAML for Perl. I have some questions about YAML::XS (ver 0.26). * 'null' is supported? * 'yes', 'no', 'on', 'off' are supported? * Date or timestamp is supported? * Is it able to parse YAML stream? * Is there any way to bind local tag to a certain data structure? example code (ex.pl): .-------------------- use strict; use YAML::XS; use Data::Dumper (); my $input = <<END; - [ ~, null ] # result: [undef, 'null'] - [ true, false, yes, no, on, off ] # result: [1, '', 'yes', 'no', 'on', 'off'] - 2008-01-01 # result: '2008-01-01' - 2008-01-01 12:34:56 # result: '2008-01-01 12:34:56' - &a1 { x: 10, y: 20 } - <<: *a1 z: 30 END #my $ydoc = YAML::XS::Load($input); my $ydoc = Load($input); print Data::Dumper::Dumper($ydoc); .-------------------- result: .==================== $ perl ex.pl $VAR1 = [ [ undef, 'null' ], [ 1, '', 'yes', 'no', 'on', 'off' ], '2008-01-01', '2008-01-01 12:34:56' { 'y' => '20', 'x' => '10' }, { '<<' => $VAR1->[4], 'z' => '30' } ]; .==================== -- regards, makoto kuwata |