Re: Passing objects

2001-05-23 Thread Paul
--- Peter Cline <[EMAIL PROTECTED]> wrote:> > >ok, so the routine is in main:: namespace? > > Is it? Does require put its arguments into the namespace from which > it was called? Yep, I think so. require 'x.pl'; is much the same as eval `cat x.pl`; Yes? > > > use NYT::Cnxdb; > > > my $c

Re: Passing objects

2001-05-23 Thread Peter Cline
> >ok, so the routine is in main:: namespace? Is it? Does require put its arguments into the namespace from which it was called? > > use NYT::Cnxdb; > > my $cnxdb = > > Cnxdb->new($conf{cnxdbUser},$conf{cnxdbPort},$conf{cnxdbTimeout}); > > die("Unable to connect to database: " . $cnxdb->getla

Re: Passing objects

2001-05-23 Thread Paul
--- Peter Cline <[EMAIL PROTECTED]> wrote: > At 01:29 PM 5/23/01 -0700, you wrote: > >I'm not sure what you mean by "multiple namespaces". Could you > >elaborate? > > I am writing a module. This module has numerous packages which are > what I am referring to (perhaps erroneously) as namespaces

Re: Passing objects

2001-05-23 Thread Peter Cline
At 01:29 PM 5/23/01 -0700, you wrote: >I'm not sure what you mean by "multiple namespaces". Could you >elaborate? I am writing a module. This module has numerous packages which are what I am referring to (perhaps erroneously) as namespaces. In this module file is a use pragma/function that t

Re: Passing objects

2001-05-23 Thread Paul
--- Peter Cline <[EMAIL PROTECTED]> wrote: > > > 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. I

Re: Passing objects

2001-05-23 Thread Peter Cline
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 =

Re: Passing objects

2001-05-23 Thread Paul
--- Peter Cline <[EMAIL PROTECTED]> wrote: > Now I'd like to know if it is possible to pass an object as an > argument to subroutine. object method calls always do. =o) $object->method() passes $object to method much like Namespace::method($object); > I tried doing this as follows: > in one