Help for this page

Select Code to Download


  1. or download this
    BEGIN {
        my @yaml_classes = qw{YAML::XS YAML::Syck YAML::Tiny YAML};
        first { eval "use $_; 1" } @yaml_classes
            or die "Unable to load any of these YAML classes: @yaml_classe
    +s";
    }
    
  2. or download this
    Unable to load any of these YAML classes: YAML::XS YAML::Syck YAML::Ti
    +ny YAML at ...
    BEGIN failed--compilation aborted at ...
    
  3. or download this
    my $yaml_class;
    BEGIN {
    ...
            or die "Unable to load any of these YAML classes: @yaml_classe
    +s";
    }
    print $yaml_class;
    
  4. or download this
    BEGIN {
        # YAML classes to attempt to load (in order of preference)
    ...
            or die "Unable to load any of these YAML classes: @yaml_classe
    +s",
                    " (using import list: @yaml_imports)";
    }
    
  5. or download this
    BEGIN {
        my @yaml_classes = qw{YAML::XS YAML::Syck YAML::Tiny YAML};
    ...
        my %yaml_exports = map { $_ => 1 } @{$yaml_class . "::EXPORT"};
        $yaml_exports{$_} or die "$yaml_class doesn't export '$_'" for @ya
    +ml_funcs;
    }