Item1705: Ensure all uses of ListIterator have a 'use' or 'require'

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Extension TopicUserMappingContrib  
Not every call to listitterator had a require resulting in perl errors under certain circumstances. Btw. having a perl require in a busy loop might not be a good idea anyway.

-- MichaelDaum

Reopening per Olivier's notes from ML so it is not forgotten

QUOTE

Sorry, but we should have written some guidelines about that... We 
discussed this quite extensively with CDot and Sven (maybe others too), 
and I think the agreed conclusion was:

If you need a module, but don't need anything it imports, don't use 
top-level require, but use:
use Module ();

So this should have been:
use Foswiki::ListIterator ();

I won't over-write your commit, but I think this rule makes sense.
If you don't see the difference, mainly, require is done at execution 
time, whereas use is done as compilation time. So:
use Foswiki::ListIterator ();
is equivalent to:
BEGIN {
    require Foswiki::ListIterator;
}

Without the (), it will call the import method of the module, which 
might not be interesting, as most of the times it's only looking for a 
function which doesn't exist, or doesn't do anything.

UNQUOTE

-- KennethLavrsen - 09 Jun 2009

Use use.

-- MichaelDaum - 10 Jun 2009

ItemTemplate edit

Summary Ensure all uses of ListIterator have a 'use' or 'require'
ReportedBy MichaelDaum
Codebase
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component TopicUserMappingContrib
Priority Normal
CurrentState Closed
WaitingFor
Checkins Foswikirev:4071 Foswikirev:4077
TargetRelease minor
ReleasedIn 1.1.0
Topic revision: r8 - 04 Oct 2010, KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License