Help for this page

Select Code to Download


  1. or download this
    use List::Util qw[ first ];
    my $class = first { eval "use $_; 1" } qw[ YAML::XS YAML::Syck YAML::T
    +iny YAML];
    
  2. or download this
    use List::Util qw[ first ];
    use Class::Load qw[ load_first_existing_class is_class_loaded ];
    ...
    
    my $class = ( first { is_class_loaded $_ } @CLASSES ) 
        || ( load_first_existing_class  @CLASSES );