"Michael C. Davis" wrote:

> Hi, I'm having trouble finding much documentation of namespaces as used
> with Cache::FileCache.  I've read the CPAN page and it doesn't say much
> about that particular issue.  Could anyone point me to anything more
> explanatory.
>
> My particular interest is in the relation between namespace and specific
> cache_root (directory location in the host's filesystem).  A namespace is
> defined relative to a specific cache_root ... right?

No.  Perl namespaces do not relate to anything external to the language itself.
Namespace systems within any external system are not related to the scoping of
identifiers in Perl.

If you are using the Cache::FileCache package, the package-level functions
exorted by the package are available to you.  Any object blessed into this
package will have access to all methods defined in the package.  Remember that
anmespace is a general term which can be applied in different contexts.  I get
the impression that you are mixing the Perl namespace paradigm with the
namespace paradigm of some completely different system.

Can you be more specific about your issue?

> In other words, if I
> switch to a different cache_root then I'm talking about a whole different
> set of entries, even if the namespace identifier happens to have the same
> value?

No.  If you are still using Cache::FileCache to define those entries, they are
still in the same Perl namespace.

>  (Or does it somehow preserve keys relative to namespace, regardless
> of where the cache is preserved in the filesystem?  That would be too wierd
> ... surely it wouldn't move a bunch of cached objects if I change the
> cache_root ... )
>
> TIA.

My suggestion would be to start thinking in terms of scope of identifier, rather
than "namespace" when dealing with namespace issues in Perl.  You are getting
hung up on the word and making false connections, on the basis of shared
terminology, between unrelated systems.  Do not mix programming constructs with
data content, even conceptually.

Joseph




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to