Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > problem using memoize in folder where a module Config.pm is

Reply
Thread Tools

problem using memoize in folder where a module Config.pm is

 
 
david
Guest
Posts: n/a
 
      01-28-2009
HI all,

I've encountered a strange thing.

I want to use Memoize from a module in a folder where a Module
Config.pm is and it tells me the following error Global symbol
"%Config" requires explicit package name at /exlibris/sfx_ver/
sfx_version_3/app/perl-5.10.0/lib/5.10.0/Memoize.pm line 74.
I see that Memoize also uses the Config module. When using Memoize
from any other folder it works perfect.
I can not change the name of the Config module since it is used in
many places.

How can i solve the problem ?

Thanks,
David
 
Reply With Quote
 
 
 
 
sln@netherlands.com
Guest
Posts: n/a
 
      01-28-2009
On Wed, 28 Jan 2009 00:06:36 -0800 (PST), david <(E-Mail Removed)> wrote:

>HI all,
>
>I've encountered a strange thing.
>
>I want to use Memoize from a module in a folder where a Module
>Config.pm is and it tells me the following error Global symbol
>"%Config" requires explicit package name at /exlibris/sfx_ver/
>sfx_version_3/app/perl-5.10.0/lib/5.10.0/Memoize.pm line 74.


This line is too long to debug, too complicated, the path to the
..pm makes it sound like its from outer space.

"requires explicit package name" - check if its declard in the scope
of the block. Or, check errors before this one which is giving false
positives.

sln

 
Reply With Quote
 
 
 
 
sergey.aleynikov@gmail.com
Guest
Posts: n/a
 
      01-29-2009
>How can i solve the problem ?

try changing "use Memoize;" with following:

BEGIN{
local @INC = grep { $_ !~ /^\./ } @INC;
require Memoize;
Memoize->import('memoize');
}

This would prevent searching for modules (Config.pm) in current folder.
 
Reply With Quote
 
david
Guest
Posts: n/a
 
      01-29-2009
On Jan 29, 1:06*pm, "(E-Mail Removed)"
<(E-Mail Removed)> wrote:
> >How can i solve the problem ?

>
> try changing "use Memoize;" with following:
>
> BEGIN{
> *local @INC = grep { $_ !~ /^\./ } @INC;
> *require Memoize;
> *Memoize->import('memoize');
>
> }
>
> This would prevent searching for modules (Config.pm) in current folder.


cool idea.
This works
 
Reply With Quote
 
Tad J McClellan
Guest
Posts: n/a
 
      01-29-2009
http://www.velocityreviews.com/forums/(E-Mail Removed) <(E-Mail Removed)> wrote:
>>How can i solve the problem ?

>
> try changing "use Memoize;" with following:
>
> BEGIN{
> local @INC = grep { $_ !~ /^\./ } @INC;



There may be babies in that bathwater.

If you want to elimnate only the current directory, then eliminate
only the current directory:

local @INC = grep { $_ ne '.' } @INC;


> require Memoize;
> Memoize->import('memoize');
> }
>
> This would prevent searching for modules (Config.pm) in current folder.



--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem using both Memoize::Expire and DB_File samwyse Perl Misc 2 07-21-2005 03:11 AM
AssertionError in pickle's memoize function Michael Hohn Python 3 10-31-2004 03:13 PM
RE: How to memoize functions? sismex01@hebmex.com Python 2 06-27-2003 05:25 PM
How to memoize functions? Chris Reedy Python 3 06-27-2003 02:18 PM
RE: How to memoize functions? sismex01@hebmex.com Python 0 06-26-2003 08:45 PM



Advertisments