Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- PERL 4.0 Reference Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

     require(EXPR)

     require EXPR

     require

             Includes the library file specified by EXPR,  or  by
             $_  if  EXPR is not supplied.  Has semantics similar
             to the following subroutine:

                  sub require {
                      local($filename) = @_;
                      return 1 if $INC{$filename};
                      local($realfilename,$result);
                      ITER: {
                       foreach $prefix (@INC) {
                           $realfilename = "$prefix/$filename";
                           if (-f $realfilename) {
                            $result = do $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;
                  }

             Note that the file will not be included twice  under
             the same specified name.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson