use File::Spec; my ($volume, $path, $file) = File::Spec->catpath($path_to_decrement); --$file; my $newpath = File::Spec->catpath($volume, $path, $file);