Re: URL.pm 2.9 (was Re: a patch for URI::URL 2.7 (?) )

Gisle Aas (aas@oslonett.no)
Wed, 10 May 1995 20:19:20 +0200


> ! # $Id: URL.pm,v 2.9 1995/05/10 09:28:42 mak Exp $'
                                                     ^                                                                 you might want to remove this

I suggest that we integrate the following patch.  This avoids loading of the Cwd module unless it is needed, which it usually isn't.

--Gisle


*** URL-2.9.pm  Wed May 10 19:59:05 1995
--- URL.pm      Wed May 10 20:08:44 1995
***************
*** 283,289 ****
  
  
  use Carp;
- require Cwd;
  
  require Exporter;
  @ISA = qw(Exporter);
--- 283,288 ----
***************
*** 427,432 ****
--- 426,432 ----
      my $url = new URI::URL "file://localhost/";
          
      unless (defined $path and $path =~ m:^/:) {
+       require Cwd;
          my $cwd = Cwd::fastcwd();
          $cwd =~ s:/?$:/:; # force trailing slash on dir
          $path = (defined $path) ? $cwd . $path : $cwd;
***************
*** 1395,1401 ****
  sub newlocal_test {
      print "newlocal_test:\n";
  
!     my $dir = Cwd::fastcwd();
  
      # cwd
      chdir('/tmp') or die $!;
--- 1395,1402 ----
  sub newlocal_test {
      print "newlocal_test:\n";
  
!     my $dir = `/bin/pwd`;
!     chomp $dir;
  
      # cwd
      chdir('/tmp') or die $!;