At 12:00 PM 5/23/01 -0700, Paul wrote:
>  $object->method()
>passes $object to method much like
>  Namespace::method($object);

Of course! I've been building perl objects over the last few days and taken 
advantage of that property of method calls (obviously), but had forgotten.


> > my $object = Class->new( ....);
>
>Looks ok. Can you access the objects methods thereafter in that scope?

Yes, I can access object methods anywhere in the file in which I created 
the object even though it has multiple namespaces.


>Is the subroutine imported?
>Maybe you should say
>   OtherfileNamespace::subroutine($object,$other_param);

This is probably at the heart of my problem.  The subroutine to which I 
want to pass the object is not part of a class.  It is simply a subroutine 
I have separated into a second file and use via a require statement.  This 
file does not utilize the use pragma to import modules (correct 
terminology)?  Is this perhaps the problem?  Maybe the namespace in this 
other file doesn't have access to the module?  If so how can I give it 
access?  I have noticed that if my object is declared globally I can use it 
to access object methods in a separate file that does not have an explicit 
use pragma.  However, I don't want to use a global variable and strict 
won't let me anyway (unless i tempoarily disable it?)

Thanks
Peter Cline
Inet Developer
New York Times Digital

Reply via email to