--- 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 file, the object is declared as
>
> my $object = Class->new( ....);
Looks ok. Can you access the objects methods thereafter in that scope?
> I tried to pass the object to a subroutine in a different file as
> such
>
> &subroutine($object,$other_param);
Is the subroutine imported?
Maybe you should say
OtherfileNamespace::subroutine($object,$other_param);
> In the receiving subroutine:
> my ($object,$other_param) = @_;
Looks ok.....
> but when I try to access an object method in this subroutine, nothing
> happens.
> Any ideas?
Maybe we need to see more of the code?
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/