home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl502b.zip / lib / OS2 / Process.pm < prev    next >
Text File  |  1996-02-26  |  1KB  |  63 lines

  1. package OS2::Process;
  2.  
  3. require Exporter;
  4. require DynaLoader;
  5. require AutoLoader;
  6.  
  7. @ISA = qw(Exporter DynaLoader);
  8. # Items to export into callers namespace by default. Note: do not export
  9. # names by default without a very good reason. Use EXPORT_OK instead.
  10. # Do not simply export all your public functions/methods/constants.
  11. @EXPORT = qw(
  12.     P_BACKGROUND
  13.     P_DEBUG
  14.     P_DEFAULT
  15.     P_DETACH
  16.     P_FOREGROUND
  17.     P_FULLSCREEN
  18.     P_MAXIMIZE
  19.     P_MINIMIZE
  20.     P_NOCLOSE
  21.     P_NOSESSION
  22.     P_NOWAIT
  23.     P_OVERLAY
  24.     P_PM
  25.     P_QUOTE
  26.     P_SESSION
  27.     P_TILDE
  28.     P_UNRELATED
  29.     P_WAIT
  30.     P_WINDOWED
  31. );
  32. sub AUTOLOAD {
  33.     # This AUTOLOAD is used to 'autoload' constants from the constant()
  34.     # XS function.  If a constant is not found then control is passed
  35.     # to the AUTOLOAD in AutoLoader.
  36.  
  37.     local($constname);
  38.     ($constname = $AUTOLOAD) =~ s/.*:://;
  39.     $val = constant($constname, @_ ? $_[0] : 0);
  40.     if ($! != 0) {
  41.     if ($! =~ /Invalid/) {
  42.         $AutoLoader::AUTOLOAD = $AUTOLOAD;
  43.         goto &AutoLoader::AUTOLOAD;
  44.     }
  45.     else {
  46.         ($pack,$file,$line) = caller;
  47.         die "Your vendor has not defined OS2::Process macro $constname, used at $file line $line.
  48. ";
  49.     }
  50.     }
  51.     eval "sub $AUTOLOAD { $val }";
  52.     goto &$AUTOLOAD;
  53. }
  54.  
  55. bootstrap OS2::Process;
  56.  
  57. # Preloaded methods go here.
  58.  
  59. # Autoload methods go after __END__, and are processed by the autosplit program.
  60.  
  61. 1;
  62. __END__
  63.