home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl_ste.zip / auto / URI / URL / file / mac_path.al < prev    next >
Text File  |  1997-11-28  |  690b  |  26 lines

  1. # NOTE: Derived from ./blib/lib/URI/URL/file.pm.  Changes made here will be lost.
  2. package URI::URL::file;
  3.  
  4. sub mac_path
  5. {
  6.     my $self = shift;
  7.     my @p;
  8.     for ($self->path_components) {
  9.     Carp::croak("Path component contains ':'") if /:/;
  10.     # XXX: Should probably want to do something about ".." and "."
  11.     # path segments.  I don't know how these are represented in
  12.     # the Machintosh file system.  If these are valid file names
  13.     # then we should split the path ourself, as $u->path_components
  14.     # loose the distinction between '.' and '%2E'.
  15.     push(@p, $_);
  16.     }
  17.     if (@p && $p[0] eq '') {
  18.     shift @p;
  19.     } else {
  20.     unshift(@p, '');
  21.     }
  22.     join(':', @p);
  23. }
  24.  
  25. 1;
  26.