home *** CD-ROM | disk | FTP | other *** search
- sub require {
- local($filename) = @_;
- return 1 if $INC{$filename};
- local($realfilename, $result);
- ITER: {
- foreach $prefix (@INC) {
- $realfilename = "$prefix/$filename";
- if (-f $realfilename) {
- $result = &$realfilename;
- last ITER;
- }
- }
- die "Can't find $filename in \@INC";
- }
- die $@ if $@;
- die "$filename did not return true value" unless $result;
- $INC{$filename} = $realfilename;
- $result;
- }
-