You can connect to a Windows share from a Mac using the network preferences, or even possibly directly from Finder.
What perl code/question does this relate to? I'd suggest google or Mac magazines at newsagents have answers to such basic OS networking questions.
the hardest line to type correctly is: stty erase ^H