Thread httpd.conf bei apche2 unter suse 9.3 ganz anders (25 answers)
Opened by Froschpopo at 2005-11-03 10:48

pq
 2005-11-09 13:17
#31229 #31229
User since
2003-08-04
12209 Artikel
Admin1
[Homepage]
user image
[quote=Froschpopo,09.11.2005, 11:10]Also ich erfinde mal ein Beispiel:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
use ModPerl::ApacheRegistry ('$x'); # oder sowas

our $x = 23;
sub handler {
sub inner {
    print "inner before: $x";
    $x = $x + 42;
    print "inner: $x";
}
}
[/quote]
das beispiel ist aber falsch.
ich sagte doch, die subroutine handler wird außenherum
geschrieben. außen heißt nicht, dass es erst nach dem our() kommt.

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package module;
use strict;
use warnings;
sub handler {
   my $x = 23;
   sub inner {
       #my $x = $x;
       print "inner before: $x\n";
       $x = $x + 42;
       print "inner: $x\n";
   }
   inner();
}
package main;
module::inner();

ergebnis:
Variable "$x" will not stay shared at handler.pl line 9.
Use of uninitialized value in concatenation (.) or string at handler.pl line 9.
inner before:
Use of uninitialized value in addition (+) at handler.pl line 10.
inner: 42

warum du keine fehler im log bekommst, weiß ich nicht, aber du warst
derjenige, der gesagt hat, dass dein skript nicht korrekt läuft. in einem
anderen thread jedenfalls.
vielleicht sieht es aber in mod_perl2 ganz anders aus. das weiß ich nicht.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread httpd.conf bei apche2 unter suse 9.3 ganz anders