[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cgiapp] $self in included modules


Hi,

does anybody can help me with bases of Object Oriented Perl? I believe
this is a simple question.

Have a look:

WebApp.pm
--------------------------------------------
package WebApp;
use base 'CGI::Application';
use WebApp::Print qw|mode1 mode2 mode3|;

[...]

sub setup {
    my $self = shift;
    $self->start_mode('mode1');
    $self->run_modes([ qw|mode1 mode2 mode3| ]);
}
--------------------------------------------

Now I have mode1, mode2 and mode3 subroutines defined in WebApp::Print module.

WebApp/Print.pm
--------------------------------------------
package WebApp::Print;
use Exporter;

@EXPORT = qw(mode1 mode2 mode3);

sub mode1 {
    my $self = shift;
    [...]
}


--------------------------------------------

It looks like $self contains nothing. When I include mode1, mode2 and
mode3 subroutines into WebApp.pm  all works OK.

The question is: how can I get the content of CGI::Application object
from included module's subroutine?

Best regards,
Wojciech Pietron

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.