in reply to Can't seem to see the problem here...

Using s/// to substitute single characters is woefully inefficient. It is much better to use tr, the transliteration operator:

  $dir =~ tr{/}{\\};

But, as has already been pointed out, even bothering to do so in this context is redundant. Another redundant operation you are performing is interpolating $dir into a string that contains nothing else "$dir". Just say $dir.

...And i'm not using strict or anything.

Well, you should be.

--
g r i n d e r