Leser: 23
1 2 3
my $action = param('action'); if (defined $action) {$action =~ s/[^a-zA-Z0-9_-]//g;} if (! undef $action) {$action = 'home';} #Negationsoperator anstatt unless
1 2 3
my $action = param('action'); if ($action) {$action =~ s/[^a-zA-Z0-9_-]//g;} unless ($action) {$action = 'home';}
du willst wohl defined statt undef verwenden.
1 2 3
my $action = param('action'); if (defined $action) {$action =~ s/[^a-zA-Z0-9_-]//g;} if (!defined $action) {$action = 'home';}
1 2 3
my $action = param('action'); if ($action) {$action =~ s/[^a-zA-Z0-9_-]//g;} if (!$action) {$action = 'home';}
1 2 3
my $action = param('action'); if (defined($action)) {$action =~ s/[^a-zA-Z0-9_-]//g;} if (!defined($action) || $action eq '') {$action = 'home';}
1 2 3 4 5
[code=perl] my $action = param('action') || undef; $action = defined $action ? $action =~ s/[^a-zA-Z0-9_-]//g : 'home' ;
1 2 3
my $action = defined param('action') ? param('action') =~ s/[^a-zA-Z0-9_-]//g : 'home' ;
2010-01-28T14:29:14 reneeBei || musst Du aufpassen...