Skip to content

Instantly share code, notes, and snippets.

@Code-Hex
Created July 30, 2015 07:34
Show Gist options
  • Save Code-Hex/060dbc4f71359f95d7d8 to your computer and use it in GitHub Desktop.
Save Code-Hex/060dbc4f71359f95d7d8 to your computer and use it in GitHub Desktop.
YAML::XSとYAML::Syck
#!/usr/bin/perl
use strict;
use warnings;
use YAML::XS;
use YAML::Syck;
use Data::Dumper;
my $filename = "osusume.yaml";
open(IN, $filename) or die("cannnot open file.");
read(IN, my $input , (-s $filename));
close(IN);
my @yxsdoc = @{YAML::XS::LoadFile($filename)->{"gist"}};
my @ysyckdoc = @{YAML::Syck::Load($input)->{"gist"}};
print Dumper @yxsdoc;
print Dumper @ysyckdoc;
=pod
in osusume.yaml
---
gist:
- test1
- test2
- test3
=cut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment