home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl502b.zip / lib / OS2 / FTP.pm next >
Text File  |  1995-05-13  |  1KB  |  67 lines

  1. package OS2::FTP;
  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.     FTPABORT
  13.     FTPCOMMAND
  14.     FTPCONNECT
  15.     FTPDATACONN
  16.     FTPHOST
  17.     FTPLOCALFILE
  18.     FTPLOGIN
  19.     FTPNOPRIMARY
  20.     FTPNOXLATETBL
  21.     FTPPROXYTHIRD
  22.     FTPSERVICE
  23.     FTPSOCKET
  24.     PINGHOST
  25.     PINGPROTO
  26.     PINGRECV
  27.     PINGREPLY
  28.     PINGSEND
  29.     PINGSOCKET
  30.     T_ASCII
  31.     T_BINARY
  32.     T_EBCDIC
  33. );
  34. @EXPORT_OK = qw(ping);
  35.  
  36. sub AUTOLOAD {
  37.     # This AUTOLOAD is used to 'autoload' constants from the constant()
  38.     # XS function.  If a constant is not found then control is passed
  39.     # to the AUTOLOAD in AutoLoader.
  40.  
  41.     local($constname);
  42.     ($constname = $AUTOLOAD) =~ s/.*:://;
  43.     $val = constant($constname, @_ ? $_[0] : 0);
  44.     if ($! != 0) {
  45.     if ($! =~ /Invalid/) {
  46.         $AutoLoader::AUTOLOAD = $AUTOLOAD;
  47.         goto &AutoLoader::AUTOLOAD;
  48.     }
  49.     else {
  50.         ($pack,$file,$line) = caller;
  51.         die "Your vendor has not defined OS2::FTP macro $constname, used at $file line $line.
  52. ";
  53.     }
  54.     }
  55.     eval "sub $AUTOLOAD { $val }";
  56.     goto &$AUTOLOAD;
  57. }
  58.  
  59. bootstrap OS2::FTP;
  60.  
  61. # Preloaded methods go here.
  62.  
  63. # Autoload methods go after __END__, and are processed by the autosplit program.
  64.  
  65. 1;
  66. __END__
  67.