LocalOverride

 view release on metacpan or  search on metacpan

lib/LocalOverride.pm  view on Meta::CPAN

    my (undef, $filename) = @_;

    # Keep track of what files we've already seen to avoid infinite loops
    return if exists $already_seen{$filename};
    $already_seen{$filename}++;

    # We only want to check overrides in $base_namespace
    return unless $filename =~ /^$base_namespace/;

    # OK, that all passed, so we can load up the actual files
    # Get the original version first, then overlay the local version
    require $filename;

    my $local_file = $filename;
    if ($base_namespace) {
        $local_file =~ s[^$base_namespace][${base_namespace}/$local_prefix];
    } else {
        # Empty base namespace is probably a bad idea, but it should be
        # handled anyhow
        $local_file = $local_prefix . '/' . $local_file;
    }



( run in 1.984 second using v1.01-cache-2.11-cpan-49f99fa48dc )