1 use strict; use warnings;
7 @YAML::Any::ISA = 'Exporter';
8 @YAML::Any::EXPORT = qw(Dump Load);
9 @YAML::Any::EXPORT_OK = qw(DumpFile LoadFile);
11 my @dump_options = qw(
29 my @load_options = qw(
34 my @implementations = qw(
43 __PACKAGE__->implementation;
44 goto &Exporter::import;
50 my $implementation = __PACKAGE__->implementation;
51 for my $option (@dump_options) {
52 my $var = "$implementation\::$option";
55 $$var = defined $value ? $value : ${"YAML::$option"};
57 return &{"$implementation\::Dump"}(@_);
63 my $implementation = __PACKAGE__->implementation;
64 for my $option (@dump_options) {
65 my $var = "$implementation\::$option";
68 $$var = defined $value ? $value : ${"YAML::$option"};
70 return &{"$implementation\::DumpFile"}(@_);
76 my $implementation = __PACKAGE__->implementation;
77 for my $option (@load_options) {
78 my $var = "$implementation\::$option";
81 $$var = defined $value ? $value : ${"YAML::$option"};
83 return &{"$implementation\::Load"}(@_);
89 my $implementation = __PACKAGE__->implementation;
90 for my $option (@load_options) {
91 my $var = "$implementation\::$option";
94 $$var = defined $value ? $value : ${"YAML::$option"};
96 return &{"$implementation\::LoadFile"}(@_);
100 return @YAML::Any::_TEST_ORDER
101 if @YAML::Any::_TEST_ORDER;
102 return @implementations;
106 my @order = __PACKAGE__->order;
107 for my $module (@order) {
111 return $module if exists $INC{$path};
112 eval "require $module; 1" and return $module;
114 croak("YAML::Any couldn't find any of these YAML implementations: @order");