Using reguar expression if varName contains the log entry...
varName =~ s/\\/\//;

That will change the slash in your example the right way. This is the most cryptic part of Perl. After that you simply look for the last occurance of a "\" character. Then substring out from position 0 to the position of the last "\".