The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Path::Resolver::Resolver::Mux::Ordered - multiplex resolvers by checking them in order

VERSION

version 3.100454

SYNOPSIS

  my $resolver = Path::Resolver::Resolver::Mux::Ordered->new({
    resolvers => [
      $resolver_1,
      $resolver_2,
      ...
    ],
  });

  my $simple_entity = $resolver->entity_at('foo/bar.txt');

This resolver looks in each of its resolvers in order and returns the result of the first of its sub-resolvers to find the named entity. If no entity is found, it returns false as usual.

The default native type of this resolver is Any, meaning that is is much more lax than other resolvers. A native_type can be specified while creating the resolver.

ATTRIBUTES

resolvers

This is an array of other resolvers. When asked for content, the Mux::Ordered resolver will check each resolver in this array and return the first found content, or false if none finds any content.

METHODS

unshift_resolver

This method will add a resolver to the beginning of the list of consulted resolvers.

push_resolver

This method will add a resolver to the end of the list of consulted resolvers.

AUTHOR

Ricardo Signes <rjbs@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Ricardo Signes.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.