use URI::file; my $base_uri = URI::file->new( URI::file->cwd ); while (my $path = ) { chomp($path); my $absolute = URI::file->new_abs( $path, $base_uri ); printf "%s + %s: %s\n", $base_uri->canonical, $path, $absolute->file; } __DATA__ ../another/ subdir/ ../../../some/other/place ../project/