digital_storm
05-24-2005, 04:46 AM
Hello
First of all I'm a JSP programmer but I have to use Perl for a special purpose.
I would like to execute another cgi script (S2) in a current cgiscript (S1). if I would have used JSP I would just have would have used "include" and that jsp page (S2) would be have executed in current page (S1). I have tried to achieve this in Perl but with no good results....If I use 'require' the script (S2) wont be, as I know, executed at runtime for (S1) what should I do to achieve this?
I have another question about my syntax and wonder why this isnt working(?)
-----------------My class Status-----------------------------
.
.
.
.
sub new() {
my $obj=shift;
$currnumber=shift;
$sid=shift;
my $session = new CGI::Session($sid);
my ($class) = @_;
$self = {
_idkey=>$currnumber,
.
.
.some values
.
.
};
bless ($self,"Status");
$session->param('user',$self);
return $self;
}
sub getidkey(){
return $self->{_idkey};
}
.
.
.
-------------------------------------------------------
from another cgi script I want to access this "session variable" and have been trying following 2 things with no good result:
(Have declared $session erlier and is working)
1) my $user=$session->param('user'); Not working
2) my $user;
my $tmp;
$tmp = $session->param('user');
$user = bless($tmp,"Status"); Not working.
and if I do:
$user->getidkey();
I will get an error saying in 1) cant find method getidkey() in main, and in 2) something with "bless" cant remember.
What should I do to make this work?
Thanks for taking your time helping me!
/D_S
First of all I'm a JSP programmer but I have to use Perl for a special purpose.
I would like to execute another cgi script (S2) in a current cgiscript (S1). if I would have used JSP I would just have would have used "include" and that jsp page (S2) would be have executed in current page (S1). I have tried to achieve this in Perl but with no good results....If I use 'require' the script (S2) wont be, as I know, executed at runtime for (S1) what should I do to achieve this?
I have another question about my syntax and wonder why this isnt working(?)
-----------------My class Status-----------------------------
.
.
.
.
sub new() {
my $obj=shift;
$currnumber=shift;
$sid=shift;
my $session = new CGI::Session($sid);
my ($class) = @_;
$self = {
_idkey=>$currnumber,
.
.
.some values
.
.
};
bless ($self,"Status");
$session->param('user',$self);
return $self;
}
sub getidkey(){
return $self->{_idkey};
}
.
.
.
-------------------------------------------------------
from another cgi script I want to access this "session variable" and have been trying following 2 things with no good result:
(Have declared $session erlier and is working)
1) my $user=$session->param('user'); Not working
2) my $user;
my $tmp;
$tmp = $session->param('user');
$user = bless($tmp,"Status"); Not working.
and if I do:
$user->getidkey();
I will get an error saying in 1) cant find method getidkey() in main, and in 2) something with "bless" cant remember.
What should I do to make this work?
Thanks for taking your time helping me!
/D_S