Questions about YAML::XS

"Makoto Kuwata" <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
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

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.