Re: [PATCHv5 08/17] gitweb: Add optional output caching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 6, 2010 at 23:06, Jakub Narebski <jnareb@xxxxxxxxx> wrote:
> On Thu, 7 Oct 2010, Ãvar ArnfjÃrà Bjarmason wrote:
>> On Wed, Oct 6, 2010 at 22:01, Jakub Narebski <jnareb@xxxxxxxxx> wrote:
>>
>> > + Â Â Â Â Â Â Â $cache ||= 'GitwebCache::SimpleFileCache';
>> > + Â Â Â Â Â Â Â eval "require $cache";
>>
>> Just:
>>
>> Â Â eval { require $cache };
>>
>> Instead?
>
> Wouldn't work correctly. ÂWe want to use 'require BAREWORD' version,
> where BAREWORD is name of module, e.g. GitwebCache::SimpleFileCache,
> and which makes Perl to search for GitwebCache/SimpleFileCache.pm
> in @INC.

Ah, I've been using perl5i too much :)

> Well, we could insert hooks into @INC, but I don't think we want to use
> such hack.

There's also:

    eval {
         my $path = $cache;
         $path =~ s[::][/]g;
         $path .= ".pm";
         require $path;
    };

But at that point it's probably easier just to use string eval. Unless there's
a performance issue (very unlikely).
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]