Created
July 30, 2015 07:34
-
-
Save Code-Hex/060dbc4f71359f95d7d8 to your computer and use it in GitHub Desktop.
YAML::XSとYAML::Syck
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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