Changeset 556

Show
Ignore:
Timestamp:
05/09/07 23:43:46 (2 years ago)
Author:
hachi
Message:

Move check for XS module availaiblity to below the definition of $VERSION. GetParserXS was depending on a specific version of Cache::Memcached, and the version check was failing in the eval searching for it. Silent problem, now fixed.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/api/perl/lib/Cache/Memcached.pm

    r538 r556  
    1919use Errno qw( EINPROGRESS EWOULDBLOCK EISCONN ); 
    2020use Cache::Memcached::GetParser; 
    21 my $HAVE_XS = eval "use Cache::Memcached::GetParserXS; 1;"; 
    22 $HAVE_XS = 0 if $ENV{NO_XS}; 
    23  
    24 my $parser_class = $HAVE_XS ? "Cache::Memcached::GetParserXS" : "Cache::Memcached::GetParser"; 
    25 if ($ENV{XS_DEBUG}) { 
    26     print "using parser: $parser_class\n"; 
    27 } 
    28  
    2921use fields qw{ 
    3022    debug no_rehash stats compress_threshold compress_enable stat_callback 
     
    4840BEGIN { 
    4941    $HAVE_ZLIB = eval "use Compress::Zlib (); 1;"; 
     42} 
     43 
     44my $HAVE_XS = eval "use Cache::Memcached::GetParserXS; 1;"; 
     45$HAVE_XS = 0 if $ENV{NO_XS}; 
     46 
     47my $parser_class = $HAVE_XS ? "Cache::Memcached::GetParserXS" : "Cache::Memcached::GetParser"; 
     48if ($ENV{XS_DEBUG}) { 
     49    print "using parser: $parser_class\n"; 
    5050} 
    5151