diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devices.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devices.cpp
index ae4574e353205c5f4132f53c97d5743dc9d01762..9d5f03e9a35e7ef736c65d637976cbe528b829bd 100644
--- a/src/plugins/qt4projectmanager/qt-s60/s60devices.cpp
+++ b/src/plugins/qt4projectmanager/qt-s60/s60devices.cpp
@@ -554,10 +554,12 @@ void S60ToolChainMixin::addEpocToEnvironment(Utils::Environment *env) const
     if (epocDir.exists(QLatin1String("epoc32/gcc/bin")))
         env->prependOrSetPath(epocDir.filePath(QLatin1String("epoc32/gcc/bin"))); // e.g. cpp.exe, *NOT* gcc.exe
     // Find perl in the special Symbian flavour:
-    if (epocDir.exists(QLatin1String("../../tools/perl/bin")))
-        env->prependOrSetPath(epocDir.filePath(QLatin1String("../../tools/perl/bin")));
-    else
+    if (epocDir.exists(QLatin1String("../../tools/perl/bin"))) {
+        epocDir.cd(QLatin1String("../../tools/perl/bin"));
+        env->prependOrSetPath(epocDir.absolutePath());
+    } else {
         env->prependOrSetPath(epocDir.filePath(QLatin1String("perl/bin")));
+    }
 
     addBaseToEnvironment(env);
 }