6 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
$session_check = session_check();
# wenn rueckgabewert dann ist was faul
if ($session_check){
$app->param('session_error' => $session_check);
$app->mode_param(sub {'login'});
}
$app->run();
my $error = $self->param('session_error');
my @error = $self->param();
1
2
3
4
my %message_to_runmode;
$message_to_runmode{'session_error'} = 'blubberdieblubb';
$message_to_runmode{'ich_bin_auch_dabei'} = 'ich in der zweite wert';
$app->param(%message_to_runmode);
1
2
3
my %message = $self->param();
my $message1 = $message{'session_error'};
my $message2 = $message{'ich_bin_auch_dabei'};
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/perl
use strict;
use warnings;
use FindBin ();
use lib $FindBin::Bin;
use TestApp;
my $webapp = TestApp->new();
$webapp->param(test => 1, one => 'hello', two => 'world');
$webapp->run();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package TestApp;
use strict;
use warnings;
use CGI::Carp qw(fatalsToBrowser);
use base ('CGI::Application');
sub setup{
my ($self) = @_;
$self->start_mode('login');
$self->mode_param('mode');
$self->run_modes(AUTOLOAD => \&login,
login => \&login,);
}
sub login{
my ($self) = @_;
my $string = "";
$string = join("<br />",map{$_ . " --> " . $self->param($_)}qw(test one two));
return $string;
}
1;
6 Einträge, 1 Seite |