Hi,
Is there any way to call a Subroutine from another package supplying an object as function parameter? I tried it with and without referencing the object, but either way it failed with a "Can't locate object method" error.
Although we know you are using CGI::Application from your last question, this question is more of a generic perl nature, and you may find better help in other forums. I find perlmonks a great resource for questions like this (http://perlmonks.org/). Also, it generally helps if you include a small snippet of code like in your last question. It gives people more of an idea of what you have tried, and usually makes it easier to give suggestions.
On that note, an instantiated object is really just a variable (usually a hash reference) that has been blessed into a class. So you can pass it around like any other variable in perl.
my $obj = My::App->new();
process_app($obj);
sub process_app {
my $app_obj = shift;
...
}Hope that helps...
Cheers,
Cees
--------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
