File: startup.pl

package info (click to toggle)
libembperl-perl 2.0rc3-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 5,688 kB
  • ctags: 5,161
  • sloc: ansic: 20,422; perl: 10,064; makefile: 5,134; cpp: 467; xml: 49; sh: 14
file content (63 lines) | stat: -rw-r--r-- 1,274 bytes parent folder | download
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

BEGIN { 
    use lib qw{ . } ;
    use ExtUtils::testlib ;
    use Cwd ;

    $ENV{MOD_PERL} =~ m#/(\d+)\.(\d+)# ;
    $mp2 = 1 if ($1 == 2 || ($1 == 1 && $2 >= 99)) ;
    
    if ($mp2 && $ENV{PERL5LIB}) 
        {
        $ENV{PERL5LIB} =~ /^(.*)$/ ;
        eval 'use lib split (/:/, $1) ;' ;
        }
    my $dir = Cwd::fastcwd ;
    $dir =~ s#/#\\#g ;
    $dir =~ /^(.+)$/ ;
    $dir = $1 ; # untaint 
    $ENV{EMBPERL_SRC} =~ /^(.*?)$/;
    my $cwd       = $1 ; # untaint
    my $i = 0 ;
    foreach (@INC)
        {
        $INC[$i] = "$cwd/$_" if (/^\.?\/?blib/) ;
        $INC[$i] = "$cwd/$1" if (/^\Q$dir\E\\(blib\\.+)$/i) ;
        $INC[$i] =~ s#//#/#g ;
        $i++ ;
        }
   


    if (!$mp2)
        {
        require Apache ;
        require Apache::Registry ;
        }
    else
        {
	eval 'use Apache2' ;
        require ModPerl::Registry ;
        }

    } ;


use Embperl ;
use Embperl::Object ;

$ENV{EMBPERL_SRC} =~ /^(.*?)$/;
my $cwd       = $1 ;

require "$cwd/test/testapp.pl" ;

$cp = Embperl::Util::AddCompartment ('TEST') ;

$cp -> deny (':base_loop') ;
$testshare = "Shared Data" ;
$cp -> share ('$testshare') ;  

##Embperl::Execute ({ inputfile  => "$ENV{EMBPERL_SRC}/test/html/div.htm", import => 0, input_escmode => 7 }) ;


1 ;