Monks,

I'm pulling my hair out on this one. I have the following script:
3 use strict; 4 use warnings; 5 use Net::FTP; 6 use Win32::Fileop; 7 8 Map F => '\\\\192.168.13.15\\c$', { persistent => 1 } 9 10 my $hostname = '192.168.14.3'; 11 my ($user, $pass) = ("user",'password'); 12 my $Local = 'f:\winnt\win32\system32\dhcp\'; 13 my $day = qw(Sun Mon Tue Wed Thu Fri Sat)[(localtime())[6]]; 14 my $file = "dhcpsvrlog\.$day"; 15 16 my $ftp=Net::FTP -> new($hostname) or die ("Connect failed"); 17 $ftp->login($user,$pass) or die ("cant Login"); 18 $ftp->put($file) or die ("Can't upload"); 19 $ftp->quit; 20 21 unmap F
and I keep getting the error:
syntax error at cp_dhcp_logs.pl line 8, near "Map F" Execution of cp_dhcp_logs.pl aborted due to compilation errors.
When I run it.

I followed the Win32::Fileop documntation to a tee, but it's still not working. Also, when I run it as such:
use strict; use warnings; use Win32::FileOp; Map F => '\\\\192.168.13.15\\c$', { persistent => 1 }
I don't get an error. Does anyone know what could be wrong?

Thanks,
Dru

In reply to Problem With Win32::Fileop by Dru

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.