Indeed. It would look for a folder named "m","y",backslash,space,"f",... Your console is expecting the name to be used as an argument in a shell command. That's the more appropriate means for command line utilities to obtain input.
$ perl -e'$s=<STDIN>; print "$ARGV[0]\n$s"' foo\ bar
moo\ mar
foo bar
moo\ mar