Thread CGI::Application Werte mit param() übergeben (5 answers)
Opened by Superfrank at 2006-09-05 12:40

renee
 2006-09-05 13:53
#8639 #8639
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Also bei funktioniert das prima:

testapp.cgi:
Code: (dl )
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();


TestApp.pm:
Code: (dl )
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;
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread CGI::Application Werte mit param() übergeben