, File:: Spec Path:: Class, :
use File::Spec;
my( $root, @path_parts ) = File::Spec->splitdir( $path );
, , , - ( ):
my $path = File::Spec->catfile( $root, @path_parts );
URL-, unix. , , ( Windows, VMS ..):
my ($docroot_root, @doc_root ) = File::Spec->splitdir( $ENV{DOCUMENT_ROOT} );
my $local_path = File::Spec->catfile( $docroot_root, @doc_root, @path_parts );
, . , , (.. 0 , ). , , , ,
my( $root, @path_parts ) = split m|/|, $path;