in reply to Simple modules

Adding "use warnings;" at the top of your code would have told you:
Unrecognized escape \k passed through at C:\Data\Perl\Script\Perl-1.pl + line 6. Unrecognized escape \k passed through at C:\Data\Perl\Script\Perl-1.pl + line 6. Unrecognized escape \s passed through at C:\Data\Perl\Script\Perl-1.pl + line 6.
immediately hinting to you that the \k, \k and \s are being interpolated.

To avoid this, use single quotes:

my $name = 'C:\karate\kid\sucks';
Of course the answer still 'sucks' ;-)

This behaviour has nothing to do with the module not "understanding" what shell or OS you are using, the interpolation already happens when you assign "C:\karate\kid\sucks" to the variable. There is no way Perl can know at that moment that this string is a filepath and that it should not use \ as an escape sequence. After all by double-quoting the string you specifically indicated that you want this to be interpolated!

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James