home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl501m.zip / lib / auto / DynaLoader / dl_expandspec.al < prev    next >
Text File  |  1995-07-03  |  1KB  |  30 lines

  1. # NOTE: Derived from lib/DynaLoader.pm.  Changes made here will be lost.
  2. package DynaLoader;
  3.  
  4. sub dl_expandspec{
  5.     my($spec) = @_;
  6.     # Optional function invoked if DynaLoader.pm sets $do_expand.
  7.     # Most systems do not require or use this function.
  8.     # Some systems may implement it in the dl_*.xs file in which case
  9.     # this autoload version will not be called but is harmless.
  10.  
  11.     # This function is designed to deal with systems which treat some
  12.     # 'filenames' in a special way. For example VMS 'Logical Names'
  13.     # (something like unix environment variables - but different).
  14.     # This function should recognise such names and expand them into
  15.     # full file paths.
  16.     # Must return undef if $spec is invalid or file does not exist.
  17.  
  18.     my($file)   = $spec; # default output to input
  19.     my($osname) = $Config{'osname'};
  20.  
  21.     if ($osname eq 'VMS'){ # dl_expandspec should be defined in dl_vms.xs
  22.     croak "dl_expandspec: should be defined in XS file!\n";
  23.     }else{
  24.     return undef unless -f $file;
  25.     }
  26.     print STDERR "dl_expandspec($spec) => $file\n" if $dl_debug;
  27.     $file;
  28. }
  29. 1;
  30.