$sh = '\\\\machine1\\d\$';
should be
$sh = '\\\\machine1\\d$';
or
$sh = "\\\\machine1\\d\$";

$\ = "\n"; print '\\\\machine1\\d\$'; # \\machine1\d\$ print '\\\\machine1\\d$'; # \\machine1\d$ print "\\\\machine1\\d\$"; # \\machine1\d$

Update:

Some elaboration:

In single quotes strings, you need to escape the delimiter (single quotes) and backslashes followed by another backslash. Lone backslashes may optionally be escaped.

In double quotes strings, you must escape $ (unless you want to interpolate), @ (unless you want to interpolate), the delimiter (double quotes) and backslashes. Other non-alphanumeric characters may optionally be escaped.

Update:

By the way,
{user=>"$us",pass=>"$pa",domain=>"$do"}
is better written as
{user=>$us,pass=>$pa,domain=>$do}
Putting quotes around variables needlessly makes a string copy of them.


In reply to Re: Mapping a drive with Win32::Fileop by ikegami
in thread Mapping a drive with Win32::Fileop by bennyroh

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.