G

DynamicLoader

Included libraries Package variables General documentation

Package variables top
Globals (from use vars definitions)
$AUTOLOAD
@INC
@EXPORT
$VERSION
@EXPORT_OK
Included modulestop
File::Find
strict
Inherit top
AutoLoader Exporter
Synopsistop
No synopsis!
Descriptiontop
No description!
Methodstop

Methods description


Methods code

BEGIN Code
BEGINtop
BEGIN {
    my $path = $ENV{HOME} . '/Plug-in';
    if($ENV{GLANG_PLUGIN}){
	$path = $ENV{GLANG_PLUGIN};
	substr($path, -1, 1) = '' if(substr($path, -1, 1) eq '/');
    }
    unshift(@INC, $path);


    no strict 'refs';
    
##1. open plug-in folder
##2. search all '*.pm'
##3. for each '*.pm' do the following
my $sub = sub { my $dir = $File::Find::name; my $dirpath = $dir; ## print $dir, "\n";return;
if(-d $dir){ $dir =~ s/^$path$/\.\//g; $dir =~ s/^$path\//\.\//g; ## print $dir, " $path\n";return;
my $file; opendir(DIR, $dirpath) || die "can't opendir $dir: $!"; $dir =~ s/^\.\//\.::/g; $dir.="::" unless($dir=~/::$/); $dir =~ s/\//::/g; $dir =~ s/^\.:://g; while(defined($file=readdir(DIR))){ if($file=~/(.+)\.pm$/){ next if ($file =~ /^\.\#/); my $dirname= $dir.$1; ## print $dirname, "\n";
eval "use $dirname"; if ($@) { warn "$@"} push(@EXPORT, @{"$dirname" . '::' . "EXPORT"}); } } closedir(DIR); } }; find($sub, "$path") if (-e $path);
}
No methods available.

General documentation

No general documentation available.