in reply to PERL backup routine

Active perl comes with Win32::Internet which has a ftp client. You can also use ppm to get libnet which has net::ftp. To do the file copy I would suggest the builtin module File::Copy.

An example of Win32::Internet:

use Win32::Internet; my $host = 'localhost'; my $user_name = 'user'; my $pass = 'password'; my $file = 'somefile'; my $inet = new Win32::Internet (); $inet->FTP($FTP, $host, $user_name, $pass) || die $!; $FTP->Put ($file) || die $!;
An example of Net::FTP:
use Net::FTP; my $host = 'localhost'; my $user_name = 'user'; my $pass = 'password'; my $file = 'somefile'; my $FTP = Net::FTP->new($host) or die $!; $FTP->login($user_name,$pass) || die $!; $FTP->put($file) || die $!;
And an example of File::Copy:
use File::Copy; my $source_file = 'somefile'; my $dest_file = 'somefile'; copy ($source_file, $dest_file) || die $!;

Replies are listed 'Best First'.
Re: Re: PERL backup routine
by phathead22 (Novice) on Jan 17, 2001 at 23:31 UTC
    When using Net:FTP as per your example, I get the following error (in debug mode or from the script):

    #" Can't locate object method "requires_firewall" via package "Net::Config" at C:/Perl/lib/net/FTP.pm line 52, <IN> line 7."

    I've looked at the Net::FTP module, and there is some code RE 'firewall'; my PERL is not strong enough to decypher...

    Suggestions?

    PH
      When I've seen that error it means you have the libnet that was distributed with activeperl. What you need to do is run ppm (it's in your perl dir), and type install libnet. It will then download and run the installation, since you already have part of libnet installed it will ask you if you want to replace it, say yes.

      PS - Sorry I didn't get back to you sooner, I was sick yesterday.