Skip Menu |

This queue is for tickets about the Cache-Memcached CPAN distribution.

Report information
The Basics
Id: 53901
Status: resolved
Priority: 0/
Queue: Cache-Memcached

People
Owner: Nobody in particular
Requestors: RSAVAGE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in:
  • 1.24
  • 1.28
Fixed in: (no value)



Subject: Should use 'require' not 'use' at run time
Hi This is under Perl 5.10.0 in Debian stable. At line 44 of V 1.24 and line 46 of V 1.28, we have: my $HAVE_XS = eval "use Cache::Memcached::GetParserXS; 1;"; This should say eval "require..."; The symptom is that it attempts to load Cache::Memcached::GetParserXS when it is /not/ installed, a couple of lines down, at: my $parser_class = $HAVE_XS ? "Cache::Memcached::GetParserXS" : "Cache::Memcached::GetParser"; despite the fact that $HAVE_XS is false. No, we can't explain it either :-(. Cheers
On Thu Jan 21 21:16:01 2010, RSAVAGE wrote: Show quoted text
> Hi > > This is under Perl 5.10.0 in Debian stable. > > At line 44 of V 1.24 and line 46 of V 1.28, we have: > > my $HAVE_XS = eval "use Cache::Memcached::GetParserXS; 1;"; > > This should say eval "require..."; > > The symptom is that it attempts to load Cache::Memcached::GetParserXS > when it is /not/ installed, a couple of lines down, at: > > my $parser_class = $HAVE_XS ? "Cache::Memcached::GetParserXS" : > "Cache::Memcached::GetParser"; > > despite the fact that $HAVE_XS is false. > > No, we can't explain it either :-(. > > Cheers
Quite strange. I wouldn't expect any difference between using require or use in a string-eval (other than one does importing and the other not, which is probably irrelevant here). Regards, Slaven
From: Bado
On Thu Jan 21 21:16:01 2010, RSAVAGE wrote: Show quoted text
> Hi > > This is under Perl 5.10.0 in Debian stable. > > At line 44 of V 1.24 and line 46 of V 1.28, we have: > > my $HAVE_XS = eval "use Cache::Memcached::GetParserXS; 1;"; > > This should say eval "require..."; > > The symptom is that it attempts to load Cache::Memcached::GetParserXS > when it is /not/ installed, a couple of lines down, at: > > my $parser_class = $HAVE_XS ? "Cache::Memcached::GetParserXS" : > "Cache::Memcached::GetParser"; > > despite the fact that $HAVE_XS is false. > > No, we can't explain it either :-(. > > Cheers
FWIW, testing the segment you referenced from version 1.28, on a Mac, it's working properly. I extracted the block to the following test script: #!/usr/bin/perl use strict; my $HAVE_XS = eval "use Cache::Memcached::GetParserXS; 1;"; $HAVE_XS = 0 if $ENV{NO_XS}; my $parser_class = $HAVE_XS ? "Cache::Memcached::GetParserXS" : "Cache::Memcached::GetParser"; if ($ENV{XS_DEBUG}) { print "using parser: $parser_class\n"; } printf("HAVE: [%s]\n", $HAVE_XS); printf("Class: [%s]\n", $parser_class); and received the following when running: [~/Desktop]$ ./test.pl HAVE: [] Class: [Cache::Memcached::GetParser]
Subject: Re: [rt.cpan.org #53901] Should use 'require' not 'use' at run time
Date: Thu, 06 May 2010 10:11:24 +1000
To: bug-Cache-Memcached [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi On Wed, 2010-05-05 at 17:04 -0400, http://mbadolato.myopenid.com/ via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=53901 > > > On Thu Jan 21 21:16:01 2010, RSAVAGE wrote:
> > Hi > > > > This is under Perl 5.10.0 in Debian stable. > > > > At line 44 of V 1.24 and line 46 of V 1.28, we have: > > > > my $HAVE_XS = eval "use Cache::Memcached::GetParserXS; 1;"; > > > > This should say eval "require..."; > > > > The symptom is that it attempts to load Cache::Memcached::GetParserXS > > when it is /not/ installed, a couple of lines down, at: > > > > my $parser_class = $HAVE_XS ? "Cache::Memcached::GetParserXS" : > > "Cache::Memcached::GetParser"; > > > > despite the fact that $HAVE_XS is false. > > > > No, we can't explain it either :-(. > > > > Cheers
> > FWIW, testing the segment you referenced from version 1.28, on a Mac, it's working properly. > I extracted the block to the following test script: > > #!/usr/bin/perl > > use strict; > > my $HAVE_XS = eval "use Cache::Memcached::GetParserXS; 1;"; > $HAVE_XS = 0 if $ENV{NO_XS}; > > my $parser_class = $HAVE_XS ? "Cache::Memcached::GetParserXS" : > "Cache::Memcached::GetParser"; > if ($ENV{XS_DEBUG}) { > print "using parser: $parser_class\n"; > } > > printf("HAVE: [%s]\n", $HAVE_XS); > printf("Class: [%s]\n", $parser_class); > > and received the following when running: > > [~/Desktop]$ ./test.pl > HAVE: [] > Class: [Cache::Memcached::GetParser]
Yep, same as my tests of the code in isolation. I'd say classify as not-a-bug until it re-appears. Thanx for the investigation. -- Ron Savage http://savage.net.au/ 0421 920 622
not a bug, apparently.