in reply to Object passing within a package
This situation looks a bit odd. Why are you creating another object inside a method call and using that as an argument to another method?
You don't need to create a reference to your $FooObj reference, so you can lose the backslash in front of it when you call barsub. If you are seeing odd behaviour, ensure $FooObj is actually an object.
package Foo::Bar; use base 'Foo'; sub foosub { my $self = shift; my $FooObj = Some::Module->new; die "Not an object!" unless ref $FooObj eq 'Some::Module'; $self->barsub( $FooObj ); } sub barsub { my $self = shift; my $FooObj = shift; ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Object passing within a package
by naChoZ (Curate) on Jan 17, 2005 at 18:20 UTC | |
by brian_d_foy (Abbot) on Jan 17, 2005 at 23:29 UTC | |
by naChoZ (Curate) on Jan 18, 2005 at 14:31 UTC | |
|
Re^2: Object passing within a package
by dragonchild (Archbishop) on Jan 17, 2005 at 16:53 UTC | |
by brian_d_foy (Abbot) on Jan 17, 2005 at 17:04 UTC |