<?xml version="1.0" encoding="windows-1252"?>
<node id="614580" title="Re: Gracefully Downgrading Behavior" created="2007-05-10 05:15:44" updated="2007-05-10 01:15:44">
<type id="11">
note</type>
<author id="368438">
gaal</author>
<data>
<field name="doctext">
(Here be plugs.)

&lt;p&gt;When there are several providers of the functionality that have compatible APIs, you can use [cpan://Best]. With modules that just export functions, you simply replace the use line:

&lt;p&gt;&lt;c&gt;
use YAML;   # This module is slow!

# So if you want to try a faster one first:

use Best qw(YAML::Syck   YAML);

print Dump({ some =&gt; 'hash' }); # Dumping provided by Best Possible YAML module
&lt;/c&gt;

&lt;p&gt;There's knobs you can use to rewire stuff as in your is_deeply example; and a &lt;c&gt;which&lt;/c&gt; function is provided so you can get the name of the module that was actually loaded to write factories with.

&lt;p&gt;&lt;c&gt;
use Best qw(OOPishProv AnotherOOPyProv::Serving::As::Fallback);

my $obj = Best-&gt;which("OOPishProv")-&gt;new;
&lt;/c&gt;

&lt;p&gt;If you're out for less syntax, you might like to try the possibly too-magical [cpan://Class::TransparentFactory].
</field>
<field name="root_node">
614574</field>
<field name="parent_node">
614574</field>
</data>
</node>
