my $srcDir = "C:\\temp"; my $path = "C:\\temp\\dest"; $path =~ s/$srcDir//i; print "new path: $path\n";