Dru has asked for the wisdom of the Perl Monks concerning the following question:

Monks,

Need your help. I have the following script running under Win2k:
use strict; use warnings; use Net::FTP; use Win32::File0p; my $hostname = '192.168.55.3'; my ($user, $pass) = ("user",'password'); my $Local = 'f:\winnt\win32\system32\dhcp\'; my $day = qw(Sun Mon Tue Wed Thu Fri Sat)[(localtime())[6]]; my $file = "dhcpsvrlog\.$day"; Map F => '\\\\192.168.1.15\\c$', { persistent => 1 } or die "Can't map drive: $!\n"; my $ftp=Net::FTP -> new($hostname) or die ("Connect failed"); $ftp->login($user,$pass) or die ("cant Login"); $ftp->put($file) or die ("Can't upload"); $ftp->quit; unmap F;
When I run it from DOS, I get the error:
Can't locate Win32/File0p.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at cp_dhcp_logs.pl line 6. BEGIN failed--compilation aborted at cp_dhcp_logs.pl line 6.
But I have another script:
use strict; use warnings; use Win32::FileOp; Map F => '\\\\192.168.1.15\\c$', { persistent => 1 };
That runs fine. I checked and Fileop.pm is under the Win32 directory in c:\perl\site\lib. Any idea what I'm doing wrong?

Thanks,
Dru

Replies are listed 'Best First'.
Re: Problems with @INC in Win
by Mr. Muskrat (Canon) on Jan 14, 2003 at 15:59 UTC

    You have a typo. Win32::File0p should be Win32::FileOp. You have a zero instead of an oh.

      sheesh. Thanks.