help with ftp

--===============1099479942==
Content-Type: multipart/alternative; boundary="0-1133406087-1262088057=:71565"

--0-1133406087-1262088057=:71565
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hello Perl Community.
Thanks so much for all the help provided lduring the current year.
Happy and prosperous New Year 2010 to all.

Below is my code where I have a problem with ftp. I am trying to transfer d=
ata from one PC to another. When I try to make a directory on the distant m=
achine, I get the error: "Can't locate object method 'mkpath' via package '=
ftp".
When I comment this part out, the same error appears later on with "ftp->pu=
t".
Both parts with problem are highlighted in yellow.

I am not able to find help in Perldoc.
Any help will be appreciated

Zilore


#!/usr/bin/perl -w
#This transfers files from a=A0 PC running LINUX to Windows PC.
#
use Net::FTP;

use strict;
use warnings;
use POSIX;
use File::Path;
use File::Copy;

my $debug =3D 1;
# set variables
#
my $User =3D 'pc-mis';
my $Pass =3D 'acmad11';
my $Host =3D '192.168.2.115';

my [at] models =3D ('arpege', 'ukmo', 'ecmf');
my [at] now =3D localtime;
my $dat =3D strftime "%Y%m%d", [at] now;
my $mon_ab =3D strftime "%b", [at] now;
my $mon_num =3D strftime "%m", [at] now;
my $mon_name =3D strftime "%B", [at] now;
my $yr=3Dstrftime "%y", [at] now;

my $dash=3D"-";
my $mod =3D "models";

my ($day, $month, $year) =3D (localtime(time() - 60 * 60 * 24)) [ 3, 4, 5 ]=
;
$year =3D $year+1900;
$month =3D $month+1;

my $dat0 =3D sprintf("%04d%02d%02d",=A0 $year, $month, $day );

my $archive_dir =3D "../ARCHIVE/$mon_num$dash$mon_name$yr";=A0=A0 # where d=
ata is

my $remote_basedir =3D '/';
my $data_dir =3D "ARCHIVE/$mon_num$dash$mon_name$yr/$mon_ab$yr$dash$mod"; #=
where to put it

my [at] localdir =3D("../ARCHIVE/$mon_num$dash$mon_name$yr/$models[0]/$dat0",
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 "../ARCHIVE/$mon_num$dash$mon_na=
me$yr/$models[1]/$dat0",
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0 "../ARCHIVE/$mon_num$dash$mon_name$yr/=
$models[2]/$dat0");

#my [at] remotedir =3D ('$data_dir/$models[0]/$dat0','$data_dir/$models[1]/$dat=
0',
#=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 '$data_dir/$models[2]/$da=
t0');

# connect to the remote host

print "Connecting to $Host ...\n";
my $ftp =3D Net::FTP->new($Host, Timeout =3D> 360, Passive =3D> 'true') or =
fail ();
=A0=A0=A0
$ftp->login($User,$Pass) or die " login '$ftp'=A0 failed: $_ ($^E)";
$ftp->binary;

foreach my $ddir ( [at] remotedir) {
=A0=A0=A0 if (! -d $ddir) {
=A0=A0=A0=A0=A0=A0=A0 print "mkpath $ddir\n" if $debug;
=A0=A0=A0=A0=A0=A0=A0 $ftp->mkpath ($ddir) or die "mkpath '$ddir' failed: $=
! ($^E)";
=A0=A0 }
}
$ftp->cwd($data_dir);

# transfer data

print "Transfering data\n";

#my %numbers =3D ('$localdirs[0]' =3D> '0','localdirs[1]' =3D> '1','localdi=
rs[2]' =3D> '2');

my %remotedirs =3D ();
my $remotedirs;
=A0=A0=A0
foreach my $model ( [at] models) {

=A0=A0=A0 # define local and remote directories before copying files

=A0=A0=A0 if ($model eq 'arpege') {
=A0=A0=A0=A0 my $remotedirs =3D "$data_dir/$models[0]/$dat0";
=A0=A0=A0 =A0=A0 $remotedirs{$remotedirs} =3D $localdir[0];

=A0 } elsif ($model eq 'ukmo') {
=A0=A0=A0=A0 my $remotedirs =3D "$data_dir/$models[1]/$dat0";
=A0=A0=A0=A0=A0=A0 $remotedirs{$remotedirs} =3D $localdir[1];

=A0 } elsif ($model eq 'ecmf') {
=A0=A0=A0=A0 my $remotedirs =3D "$data_dir/$models[2]/$dat0";
=A0=A0=A0=A0=A0=A0 $remotedirs{$remotedirs} =3D $localdir[2];
=A0 }
=A0
=A0=A0=A0 # Transfer files

=A0=A0=A0 foreach my $rdir (keys %remotedirs) {
=A0=A0=A0 =A0$ftp->cwd($remotedirs($rdir));

=A0=A0=A0=A0 my $ldir =3D $remotedirs{$rdir}
=A0=A0=A0=A0
=A0=A0=A0 =A0print "Transfering files from $ldir to $remotedirs(rdir)\n" if=
$debug;
=A0=A0=A0=A0 opendir DIR, "$ldir" or die "opendir '$ldir: $! ($^E)";
=A0=A0=A0=A0 while (my $file =3D readdir DIR) {
=A0=A0=A0=A0=A0=A0=A0 print "DIR";
=A0=A0=A0=A0=A0=A0=A0 exit;
=A0=A0=A0=A0=A0=A0=A0 next if $file =3D~ /\*(b|x|l)$/;
=A0=A0=A0=A0=A0=A0=A0 print "Putting $file\n" if $debug;
=A0=A0=A0=A0=A0=A0=A0 ftp->put($file) or warn "Failed '$file': $! ($^E)";
=A0=A0=A0=A0 }
=A0=A0=A0=A0 closedir DIR;
=A0
=A0=A0=A0 }
}

$ftp->close;
print "Transfering ends\n";
exit 0;

#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D
#=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A 0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0 Subroutines
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D

sub fail {

$ftp->quit;
die "ftp error occurred\n";

}


__END__

my $files =3D $ftp->dir() or die "Error doing ftp->dir: $!\n";
my $files =3D dir() or die "Error doing dir: $!\n";
foreach ( [at] $files) {
=A0=A0=A0 # skip lines not starting with d or -
=A0=A0=A0 if (/^[^d-]/) {
=A0=A0=A0=A0=A0=A0=A0=A0 print "Skipping garbage dir line\n" if $debug;
=A0=A0=A0=A0=A0=A0=A0 next;
=A0=A0=A0 }

# ftp dir listing
#----0----- -1- ---2---- ---3---- ---4---- -5- -6 --7-- -----8--------
#total 52
#drwx--x---=A0=A0 3 owner=A0=A0=A0 group=A0=A0=A0=A0=A0=A0=A0 1024 Dec 13=
=A0 1997 .
#drwxr-xr-x 671 owner=A0=A0=A0 group=A0=A0=A0=A0=A0=A0 49152 Dec 18 14:09 .=
..
#-rw-r--r--=A0=A0 1 xyz=A0=A0=A0=A0=A0 httpd=A0=A0=A0=A0=A0=A0=A0 2010 Sep =
21 13:31 index.htm

=A0=A0=A0 my ($size, $file) =3D (split /\s+/, $_, 9)[4,8];=A0=A0=A0 # get s=
ize/filename
=A0=A0=A0 next if $file =3D~ /^\.{1,2}$/;=A0=A0=A0=A0=A0=A0=A0 # skip . and=
..

=A0=A0=A0 # if directory - call directory recurse routine

=A0=A0=A0 if (/^d/) {
=A0=A0=A0=A0=A0=A0=A0 ...


=0A=0A=0A
--0-1133406087-1262088057=:71565
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0" ><tr><td valign=3D"=
top" style=3D"font: inherit;">Hello Perl Community.<br>Thanks so much for a=
ll the help provided lduring the current year.<br>Happy and prosperous New =
Year 2010 to all.<br><br>Below is my code where I have a problem with ftp. =
I am trying to transfer data from one PC to another. When I try to make a d=
irectory on the distant machine, I get the error: "Can't locate object meth=
od 'mkpath' via package 'ftp".<br>When I comment this part out, the same er=
ror appears later on with "ftp->put".<br>Both parts with problem are hig=
hlighted in yellow.<br><br>I am not able to find help in Perldoc.<br>Any he=
lp will be appreciated<br><br>Zilore<br><br><br>#!/usr/bin/perl -w<br>#This=
transfers files from a  PC running LINUX to Windows PC.<br>#<br>use N=
et::FTP;<br><br>use strict;<br>use warnings;<br>use POSIX;<br>use File::Pat=
h;<br>use File::Copy;<br><br>my $debug =3D 1;<br># set variables<br>#<br>my
$User =3D 'pc-mis';<br>my $Pass =3D 'acmad11';<br>my $Host =3D '192.168.2.=
115';<br><br>my [at] models =3D ('arpege', 'ukmo', 'ecmf');<br>my [at] now =3D loca=
ltime;<br>my $dat =3D strftime "%Y%m%d", [at] now;<br>my $mon_ab =3D strftime "=
%b", [at] now;<br>my $mon_num =3D strftime "%m", [at] now;<br>my $mon_name =3D strfti=
me "%B", [at] now;<br>my $yr=3Dstrftime "%y", [at] now;<br><br>my $dash=3D"-";<br>my =
$mod =3D "models";<br><br>my ($day, $month, $year) =3D (localtime(time() - =
60 * 60 * 24)) [ 3, 4, 5 ];<br>$year =3D $year+1900;<br>$month =3D $month+1=
;<br><br>my $dat0 =3D sprintf("%04d%02d%02d",  $year, $month, $day );<=
br><br>my $archive_dir =3D "../ARCHIVE/$mon_num$dash$mon_name$yr"; &nb=
sp; # where data is<br><br>my $remote_basedir =3D '/';<br>my $data_dir =3D =
"ARCHIVE/$mon_num$dash$mon_name$yr/$mon_ab$yr$dash$mod"; #where to put it<b=
r><br>my [at] localdir =3D("../ARCHIVE/$mon_num$dash$mon_name$yr/$models[0]/$da=
t0",<br>           &=
nbsp;  
"../ARCHIVE/$mon_num$dash$mon_name$yr/$models[1]/$dat0",<br>  &n=
bsp;            "../ARCHIVE/$mon_nu=
m$dash$mon_name$yr/$models[2]/$dat0"); <br><br>#my [at] remotedir =3D ('$data_d=
ir/$models[0]/$dat0','$data_dir/$models[1]/$dat0',<br>#   &n=
bsp;            =
; '$data_dir/$models[2]/$dat0');<br><br># connect to the remote host<br><br=
>print "Connecting to $Host ...\n";<br>my $ftp =3D Net::FTP->new($Host, =
Timeout =3D> 360, Passive =3D> 'true') or fail ();<br>  &nb=
sp; <br>$ftp->login($User,$Pass) or die " login '$ftp'  failed: $_ =
($^E)";<br>$ftp->binary;<br><br><span style=3D"background-color: rgb(255=
, 255, 0);">foreach my $ddir ( [at] remotedir) {</span><br style=3D"background-c=
olor: rgb(255, 255, 0);"><span style=3D"background-color: rgb(255, 255, 0);=
">    if (! -d $ddir) {</span><br style=3D"background-color:=
rgb(255,
255, 0);"><span style=3D"background-color: rgb(255, 255, 0);">  =
      print "mkpath $ddir\n" if $debug;</span><br =
style=3D"background-color: rgb(255, 255, 0);"><span style=3D"background-col=
or: rgb(255, 255, 0);">        $ftp->=
mkpath ($ddir) or die "mkpath '$ddir' failed: $! ($^E)";</span><br style=3D=
"background-color: rgb(255, 255, 0);"><span style=3D"background-color: rgb(=
255, 255, 0);">   }</span><br style=3D"background-color: rgb(255,=
255, 0);"><span style=3D"background-color: rgb(255, 255, 0);">}</span><br>=
$ftp->cwd($data_dir);<br><br># transfer data<br><br>print "Transfering d=
ata\n";<br><br>#my %numbers =3D ('$localdirs[0]' =3D> '0','localdirs[1]'=
=3D> '1','localdirs[2]' =3D> '2');<br><br>my %remotedirs =3D ();<br>=
my $remotedirs;<br>    <br>foreach my $model ( [at] models) {<br>=
<br>    # define local and remote directories before copying
files<br><br>    if ($model eq 'arpege') {<br>  &=
nbsp;  my $remotedirs =3D "$data_dir/$models[0]/$dat0";<br>  =
;     $remotedirs{$remotedirs} =3D $localdir[0];<br><br>&nbs=
p; } elsif ($model eq 'ukmo') {<br>     my $remotedirs =
=3D "$data_dir/$models[1]/$dat0";<br>       $=
remotedirs{$remotedirs} =3D $localdir[1];<br><br>  } elsif ($model eq =
'ecmf') {<br>     my $remotedirs =3D "$data_dir/$models=
[2]/$dat0";<br>       $remotedirs{$remotedirs=
} =3D $localdir[2];<br>  }<br>  <br>    # Transfer=
files<br><br>    foreach my $rdir (keys %remotedirs) {<br>&=
nbsp;    $ftp->cwd($remotedirs($rdir));<br><br> &nbs=
p;   my $ldir =3D $remotedirs{$rdir}<br>     =
<br>     print "Transfering files from $ldir to
$remotedirs(rdir)\n" if $debug;<br>     opendir DIR, "=
$ldir" or die "opendir '$ldir: $! ($^E)";<br>     while=
(my $file =3D readdir DIR) {<br>       =
print "DIR";<br>        exit;<br> =
       next if $file =3D~ /\*(b|x|l)$/;<br>&n=
bsp;       print "Putting $file\n" if $debug;=
<br>        <span style=3D"background-co=
lor: rgb(255, 255, 0);">ftp->put($file) or warn "Failed '$file': $! ($^E=
)";</span><br>     }<br>     closed=
ir DIR;<br>  <br>    }<br>}<br><br>$ftp->close;<br>p=
rint "Transfering ends\n";<br>exit
0;<br><br> #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D<br>#         &=
nbsp;           &nbs=
p;          Subroutines<br>#=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D<br><br>sub fail {<br><br>$ftp->quit;<br>die "ftp error occurred\n";<=
br><br>}<br><br><br>__END__<br><br>my $files =3D $ftp->dir() or die "Err=
or doing ftp->dir: $!\n";<br>my $files =3D dir() or die "Error doing dir=
: $!\n";<br>foreach ( [at] $files) {<br>    # skip lines not star=
ting with d or -<br>    if (/^[^d-]/) {<br>   =
;      print "Skipping garbage dir line\n" if $deb=
ug;<br>        next;<br>  &nbs=
p; }<br><br># ftp dir listing<br>#----0----- -1- ---2---- ---3---- ---4----
-5- -6 --7-- -----8--------<br>#total 52<br>#drwx--x---   3 owne=
r    group        1024 De=
c 13  1997 .<br>#drwxr-xr-x 671 owner    group &nb=
sp;     49152 Dec 18 14:09 ..<br>#-rw-r--r--  =
; 1 xyz      httpd     &n=
bsp;  2010 Sep 21 13:31 index.htm<br><br>    my ($size,=
$file) =3D (split /\s+/, $_, 9)[4,8];    # get size/filenam=
e<br>    next if $file =3D~ /^\.{1,2}$/;   &n=
bsp;    # skip . and ..<br><br>    # if direc=
tory - call directory recurse routine<br><br>    if (/^d/) {=
<br>        ...<br><br><br></td></tr></t=
able><br>=0A=0A
--0-1133406087-1262088057=:71565--

--===============1099479942==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1099479942==--
zilore mumba [ Di, 29 Dezember 2009 13:00 ] [ ID #2027369 ]

RE: help with ftp

--===============1205395663==
Content-Language: en-US
Content-Type: multipart/alternative;
boundary="_000_6DFE695E783E004A9E6D2CD1E0B8CA1F0BED995FD8bma il2bigfixc_"

--_000_6DFE695E783E004A9E6D2CD1E0B8CA1F0BED995FD8bmail2bigfi xc_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

from the pod:

mkdir ( DIR [, RECURSE ])

Create a new directory with the name DIR. If RECURSE is true then mkdir wil=
l attempt to create all the directories in the given path.





________________________________
From: activeperl-bounces [at] listserv.ActiveState.com [activeperl-bounces [at] lists=
erv.ActiveState.com] On Behalf Of zilore mumba [zmumba [at] yahoo.com]
Sent: Tuesday, December 29, 2009 6:00 AM
To: activeperl [at] listserv.activestate.com
Subject: help with ftp

Hello Perl Community.
Thanks so much for all the help provided lduring the current year.
Happy and prosperous New Year 2010 to all.

Below is my code where I have a problem with ftp. I am trying to transfer d=
ata from one PC to another. When I try to make a directory on the distant m=
achine, I get the error: "Can't locate object method 'mkpath' via package '=
ftp".
When I comment this part out, the same error appears later on with "ftp->pu=
t".
Both parts with problem are highlighted in yellow.

I am not able to find help in Perldoc.
Any help will be appreciated

Zilore


#!/usr/bin/perl -w
#This transfers files from a PC running LINUX to Windows PC.
#
use Net::FTP;

use strict;
use warnings;
use POSIX;
use File::Path;
use File::Copy;

my $debug =3D 1;
# set variables
#
my $User =3D 'pc-mis';
my $Pass =3D 'acmad11';
my $Host =3D '192.168.2.115';

my [at] models =3D ('arpege', 'ukmo', 'ecmf');
my [at] now =3D localtime;
my $dat =3D strftime "%Y%m%d", [at] now;
my $mon_ab =3D strftime "%b", [at] now;
my $mon_num =3D strftime "%m", [at] now;
my $mon_name =3D strftime "%B", [at] now;
my $yr=3Dstrftime "%y", [at] now;

my $dash=3D"-";
my $mod =3D "models";

my ($day, $month, $year) =3D (localtime(time() - 60 * 60 * 24)) [ 3, 4, 5 ]=
;
$year =3D $year+1900;
$month =3D $month+1;

my $dat0 =3D sprintf("%04d%02d%02d", $year, $month, $day );

my $archive_dir =3D "../ARCHIVE/$mon_num$dash$mon_name$yr"; # where data =
is

my $remote_basedir =3D '/';
my $data_dir =3D "ARCHIVE/$mon_num$dash$mon_name$yr/$mon_ab$yr$dash$mod"; #=
where to put it

my [at] localdir =3D("../ARCHIVE/$mon_num$dash$mon_name$yr/$models[0]/$dat0",
"../ARCHIVE/$mon_num$dash$mon_name$yr/$models[1]/$dat0",
"../ARCHIVE/$mon_num$dash$mon_name$yr/$models[2]/$dat0");

#my [at] remotedir =3D ('$data_dir/$models[0]/$dat0','$data_dir/$models[1]/$dat=
0',
# '$data_dir/$models[2]/$dat0');

# connect to the remote host

print "Connecting to $Host ...\n";
my $ftp =3D Net::FTP->new($Host, Timeout =3D> 360, Passive =3D> 'true') or =
fail ();

$ftp->login($User,$Pass) or die " login '$ftp' failed: $_ ($^E)";
$ftp->binary;

foreach my $ddir ( [at] remotedir) {
if (! -d $ddir) {
print "mkpath $ddir\n" if $debug;
$ftp->mkpath ($ddir) or die "mkpath '$ddir' failed: $! ($^E)";
}
}
$ftp->cwd($data_dir);

# transfer data

print "Transfering data\n";

#my %numbers =3D ('$localdirs[0]' =3D> '0','localdirs[1]' =3D> '1','localdi=
rs[2]' =3D> '2');

my %remotedirs =3D ();
my $remotedirs;

foreach my $model ( [at] models) {

# define local and remote directories before copying files

if ($model eq 'arpege') {
my $remotedirs =3D "$data_dir/$models[0]/$dat0";
$remotedirs{$remotedirs} =3D $localdir[0];

} elsif ($model eq 'ukmo') {
my $remotedirs =3D "$data_dir/$models[1]/$dat0";
$remotedirs{$remotedirs} =3D $localdir[1];

} elsif ($model eq 'ecmf') {
my $remotedirs =3D "$data_dir/$models[2]/$dat0";
$remotedirs{$remotedirs} =3D $localdir[2];
}

# Transfer files

foreach my $rdir (keys %remotedirs) {
$ftp->cwd($remotedirs($rdir));

my $ldir =3D $remotedirs{$rdir}

print "Transfering files from $ldir to $remotedirs(rdir)\n" if $debug;
opendir DIR, "$ldir" or die "opendir '$ldir: $! ($^E)";
while (my $file =3D readdir DIR) {
print "DIR";
exit;
next if $file =3D~ /\*(b|x|l)$/;
print "Putting $file\n" if $debug;
ftp->put($file) or warn "Failed '$file': $! ($^E)";
}
closedir DIR;

}
}

$ftp->close;
print "Transfering ends\n";
exit 0;

#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D
# Subroutines
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D

sub fail {

$ftp->quit;
die "ftp error occurred\n";

}


__END__

my $files =3D $ftp->dir() or die "Error doing ftp->dir: $!\n";
my $files =3D dir() or die "Error doing dir: $!\n";
foreach ( [at] $files) {
# skip lines not starting with d or -
if (/^[^d-]/) {
print "Skipping garbage dir line\n" if $debug;
next;
}

# ftp dir listing
#----0----- -1- ---2---- ---3---- ---4---- -5- -6 --7-- -----8--------
#total 52
#drwx--x--- 3 owner group 1024 Dec 13 1997 .
#drwxr-xr-x 671 owner group 49152 Dec 18 14:09 ..
#-rw-r--r-- 1 xyz httpd 2010 Sep 21 13:31 index.htm

my ($size, $file) =3D (split /\s+/, $_, 9)[4,8]; # get size/filename
next if $file =3D~ /^\.{1,2}$/; # skip . and ..

# if directory - call directory recurse routine

if (/^d/) {
...





--_000_6DFE695E783E004A9E6D2CD1E0B8CA1F0BED995FD8bmail2bigfi xc_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html dir=3D"ltr"><head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<meta content=3D"MSHTML 6.00.2900.3640" name=3D"GENERATOR">
<style title=3D"owaParaStyle"><!--P {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
--></style>
</head>
<body ocsi=3D"x">
<div dir=3D"ltr"><font face=3D"Tahoma" color=3D"#000000" size=3D"2">from th=
e pod:</font></div>
<div dir=3D"ltr"><font face=3D"tahoma" size=3D"2"></font> </div>
<div dir=3D"ltr"><dt><a name=3D"mkdir_(_DIR_[,_RECURSE_])">mkdir ( DIR [, R=
ECURSE ])</a>
</dt><dd>
<p>Create a new directory with the name <code>DIR</code>. If <code>RECURSE<=
/code> is
<i>true</i> then <code>mkdir</code> will attempt to create all the director=
ies in the given path.</p>
</dd></div>
<p dir=3D"ltr"><font face=3D"times new roman"></font> </p>
<p dir=3D"ltr"> </p>
<div id=3D"divRpF981374" style=3D"DIRECTION: ltr">
<hr tabindex=3D"-1">
<font face=3D"Tahoma" size=3D"2"><b>From:</b> activeperl-bounces [at] listserv.A=
ctiveState.com [activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of z=
ilore mumba [zmumba [at] yahoo.com]<br>
<b>Sent:</b> Tuesday, December 29, 2009 6:00 AM<br>
<b>To:</b> activeperl [at] listserv.activestate.com<br>
<b>Subject:</b> help with ftp<br>
</font><br>
</div>
<div></div>
<div>
<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0">
<tbody>
<tr>
<td valign=3D"top">Hello Perl Community.<br>
Thanks so much for all the help provided lduring the current year.<br>
Happy and prosperous New Year 2010 to all.<br>
<br>
Below is my code where I have a problem with ftp. I am trying to transfer d=
ata from one PC to another. When I try to make a directory on the distant m=
achine, I get the error: "Can't locate object method 'mkpath' via pack=
age 'ftp".<br>
When I comment this part out, the same error appears later on with "ft=
p->put".<br>
Both parts with problem are highlighted in yellow.<br>
<br>
I am not able to find help in Perldoc.<br>
Any help will be appreciated<br>
<br>
Zilore<br>
<br>
<br>
#!/usr/bin/perl -w<br>
#This transfers files from a  PC running LINUX to Windows PC.<br>
#<br>
use Net::FTP;<br>
<br>
use strict;<br>
use warnings;<br>
use POSIX;<br>
use File::Path;<br>
use File::Copy;<br>
<br>
my $debug =3D 1;<br>
# set variables<br>
#<br>
my $User =3D 'pc-mis';<br>
my $Pass =3D 'acmad11';<br>
my $Host =3D '192.168.2.115';<br>
<br>
my [at] models =3D ('arpege', 'ukmo', 'ecmf');<br>
my [at] now =3D localtime;<br>
my $dat =3D strftime "%Y%m%d", [at] now;<br>
my $mon_ab =3D strftime "%b", [at] now;<br>
my $mon_num =3D strftime "%m", [at] now;<br>
my $mon_name =3D strftime "%B", [at] now;<br>
my $yr=3Dstrftime "%y", [at] now;<br>
<br>
my $dash=3D"-";<br>
my $mod =3D "models";<br>
<br>
my ($day, $month, $year) =3D (localtime(time() - 60 * 60 * 24)) [ 3, 4, 5 ]=
;<br>
$year =3D $year+1900;<br>
$month =3D $month+1;<br>
<br>
my $dat0 =3D sprintf("%04d%02d%02d",  $year, $month, $day );=
<br>
<br>
my $archive_dir =3D "../ARCHIVE/$mon_num$dash$mon_name$yr"; =
  # where data is<br>
<br>
my $remote_basedir =3D '/';<br>
my $data_dir =3D "ARCHIVE/$mon_num$dash$mon_name$yr/$mon_ab$yr$dash$mo=
d"; #where to put it<br>
<br>
my [at] localdir =3D("../ARCHIVE/$mon_num$dash$mon_name$yr/$models[0]/$dat=
0",<br>
            &nb=
sp;  "../ARCHIVE/$mon_num$dash$mon_name$yr/$models[1]/$dat0"=
,<br>
               "=
;../ARCHIVE/$mon_num$dash$mon_name$yr/$models[2]/$dat0"); <br>
<br>
#my [at] remotedir =3D ('$data_dir/$models[0]/$dat0','$data_dir/$models[1]/$dat=
0',<br>
#            &n=
bsp;    '$data_dir/$models[2]/$dat0');<br>
<br>
# connect to the remote host<br>
<br>
print "Connecting to $Host ...\n";<br>
my $ftp =3D Net::FTP->new($Host, Timeout =3D> 360, Passive =3D> 't=
rue') or fail ();<br>
    <br>
$ftp->login($User,$Pass) or die " login '$ftp'  failed: $_ ($^=
E)";<br>
$ftp->binary;<br>
<br>
<span style=3D"BACKGROUND-COLOR: rgb(255,255,0)">foreach my $ddir ( [at] remoted=
ir) {</span><br style=3D"BACKGROUND-COLOR: rgb(255,255,0)">
<span style=3D"BACKGROUND-COLOR: rgb(255,255,0)">    if (! -=
d $ddir) {</span><br style=3D"BACKGROUND-COLOR: rgb(255,255,0)">
<span style=3D"BACKGROUND-COLOR: rgb(255,255,0)">    &n=
bsp;   print "mkpath $ddir\n" if $debug;</span><br styl=
e=3D"BACKGROUND-COLOR: rgb(255,255,0)">
<span style=3D"BACKGROUND-COLOR: rgb(255,255,0)">    &n=
bsp;   $ftp->mkpath ($ddir) or die "mkpath '$ddir' failed=
: $! ($^E)";</span><br style=3D"BACKGROUND-COLOR: rgb(255,255,0)">
<span style=3D"BACKGROUND-COLOR: rgb(255,255,0)">   }</span><br s=
tyle=3D"BACKGROUND-COLOR: rgb(255,255,0)">
<span style=3D"BACKGROUND-COLOR: rgb(255,255,0)">}</span><br>
$ftp->cwd($data_dir);<br>
<br>
# transfer data<br>
<br>
print "Transfering data\n";<br>
<br>
#my %numbers =3D ('$localdirs[0]' =3D> '0','localdirs[1]' =3D> '1','l=
ocaldirs[2]' =3D> '2');<br>
<br>
my %remotedirs =3D ();<br>
my $remotedirs;<br>
    <br>
foreach my $model ( [at] models) {<br>
<br>
    # define local and remote directories before copying fil=
es<br>
<br>
    if ($model eq 'arpege') {<br>
     my $remotedirs =3D "$data_dir/$models[0]/$dat=
0";<br>
       $remotedirs{$remotedirs} =3D $localdir[0];<=
br>
<br>
  } elsif ($model eq 'ukmo') {<br>
     my $remotedirs =3D "$data_dir/$models[1]/$dat=
0";<br>
       $remotedirs{$remotedirs} =3D $localdir=
[1];<br>
<br>
  } elsif ($model eq 'ecmf') {<br>
     my $remotedirs =3D "$data_dir/$models[2]/$dat=
0";<br>
       $remotedirs{$remotedirs} =3D $localdir=
[2];<br>
  }<br>
  <br>
    # Transfer files<br>
<br>
    foreach my $rdir (keys %remotedirs) {<br>
     $ftp->cwd($remotedirs($rdir));<br>
<br>
     my $ldir =3D $remotedirs{$rdir}<br>
     <br>
     print "Transfering files from $ldir to $remot=
edirs(rdir)\n" if $debug;<br>
     opendir DIR, "$ldir" or die "opendi=
r '$ldir: $! ($^E)";<br>
     while (my $file =3D readdir DIR) {<br>
        print "DIR";<br>
        exit;<br>
        next if $file =3D~ /\*(b|x|l)$/;=
<br>
        print "Putting $file\n"=
; if $debug;<br>
        <span style=3D"BACKGROUND-COLOR:=
rgb(255,255,0)">ftp->put($file) or warn "Failed '$file': $! ($^E)&=
quot;;</span><br>
     }<br>
     closedir DIR;<br>
  <br>
    }<br>
}<br>
<br>
$ftp->close;<br>
print "Transfering ends\n";<br>
exit 0;<br>
<br>
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D<br>
#            &n=
bsp;            =
;       Subroutines<br>
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D<br>
<br>
sub fail {<br>
<br>
$ftp->quit;<br>
die "ftp error occurred\n";<br>
<br>
}<br>
<br>
<br>
__END__<br>
<br>
my $files =3D $ftp->dir() or die "Error doing ftp->dir: $!\n&quo=
t;;<br>
my $files =3D dir() or die "Error doing dir: $!\n";<br>
foreach ( [at] $files) {<br>
    # skip lines not starting with d or -<br>
    if (/^[^d-]/) {<br>
         print "Skipping garba=
ge dir line\n" if $debug;<br>
        next;<br>
    }<br>
<br>
# ftp dir listing<br>
#----0----- -1- ---2---- ---3---- ---4---- -5- -6 --7-- -----8--------<br>
#total 52<br>
#drwx--x---   3 owner    group   &n=
bsp;    1024 Dec 13  1997 .<br>
#drwxr-xr-x 671 owner    group     =
  49152 Dec 18 14:09 ..<br>
#-rw-r--r--   1 xyz      httpd &nbs=
p;      2010 Sep 21 13:31 index.htm<br>
<br>
    my ($size, $file) =3D (split /\s+/, $_, 9)[4,8];&nbs=
p;   # get size/filename<br>
    next if $file =3D~ /^\.{1,2}$/;    &=
nbsp;   # skip . and ..<br>
<br>
    # if directory - call directory recurse routine<br>
<br>
    if (/^d/) {<br>
        ...<br>
<br>
<br>
</td>
</tr>
</tbody>
</table>
<br>
</div>
</body>
</html>

--_000_6DFE695E783E004A9E6D2CD1E0B8CA1F0BED995FD8bmail2bigfi xc_--

--===============1205395663==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1205395663==--
Jeff Saxton [ Di, 29 Dezember 2009 15:45 ] [ ID #2027370 ]

RE: help with ftp

This is a multi-part message in MIME format.

--===============1653116433==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01CA88A6.D767EADA"

This is a multi-part message in MIME format.

------_=_NextPart_001_01CA88A6.D767EADA
Content-Type: text/plain;
charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Another bug, the "if (! -d $ddir)" command in your highlighted foreach
loop checks your local hard drive to see if the directory exists, not
the remote server you are connecting to, which is what I assume you
meant.

I don't see a check if directory or file exists command, so you'd have
to cwd() to that dir & verify it succeeded, or parse what's returned by
list() or nlst(). If it failed, then you can assume the directory
doesn't exist.

As for your 2nd highlighted block, you said "ftp->put" instead of
"$ftp->put". Makes a world of difference.

________________________________

From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of Jeff
Saxton
Sent: Tuesday, December 29, 2009 6:45 AM
To: zilore mumba; activeperl [at] listserv.activestate.com
Subject: RE: help with ftp


from the pod:

mkdir ( DIR [, RECURSE ])
Create a new directory with the name DIR. If RECURSE is true then mkdir
will attempt to create all the directories in the given path.





________________________________

From: activeperl-bounces [at] listserv.ActiveState.com
[activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of zilore mumba
[zmumba [at] yahoo.com]
Sent: Tuesday, December 29, 2009 6:00 AM
To: activeperl [at] listserv.activestate.com
Subject: help with ftp


Hello Perl Community.
Thanks so much for all the help provided lduring the current year.
Happy and prosperous New Year 2010 to all.

Below is my code where I have a problem with ftp. I am trying to
transfer data from one PC to another. When I try to make a directory on
the distant machine, I get the error: "Can't locate object method
'mkpath' via package 'ftp".
When I comment this part out, the same error appears later on with
"ftp->put".
Both parts with problem are highlighted in yellow.

I am not able to find help in Perldoc.
Any help will be appreciated

Zilore


#!/usr/bin/perl -w
#This transfers files from a PC running LINUX to Windows PC.
#
use Net::FTP;

use strict;
use warnings;
use POSIX;
use File::Path;
use File::Copy;

my $debug =3D 1;
# set variables
#
my $User =3D 'pc-mis';
my $Pass =3D 'acmad11';
my $Host =3D '192.168.2.115';

my [at] models =3D ('arpege', 'ukmo', 'ecmf');
my [at] now =3D localtime;
my $dat =3D strftime "%Y%m%d", [at] now;
my $mon_ab =3D strftime "%b", [at] now;
my $mon_num =3D strftime "%m", [at] now;
my $mon_name =3D strftime "%B", [at] now;
my $yr=3Dstrftime "%y", [at] now;

my $dash=3D"-";
my $mod =3D "models";

my ($day, $month, $year) =3D (localtime(time() - 60 * 60 * 24)) [ 3, 4, =
5
];
$year =3D $year+1900;
$month =3D $month+1;

my $dat0 =3D sprintf("%04d%02d%02d", $year, $month, $day );

my $archive_dir =3D "../ARCHIVE/$mon_num$dash$mon_name$yr"; # where =
data
is

my $remote_basedir =3D '/';
my $data_dir =3D =
"ARCHIVE/$mon_num$dash$mon_name$yr/$mon_ab$yr$dash$mod";
#where to put it

my [at] localdir =
=3D("../ARCHIVE/$mon_num$dash$mon_name$yr/$models[0]/$dat0",
"../ARCHIVE/$mon_num$dash$mon_name$yr/$models[1]/$dat0",
"../ARCHIVE/$mon_num$dash$mon_name$yr/$models[2]/$dat0");


#my [at] remotedir =3D
('$data_dir/$models[0]/$dat0','$data_dir/$models[1]/$dat0',
# '$data_dir/$models[2]/$dat0');

# connect to the remote host

print "Connecting to $Host ...\n";
my $ftp =3D Net::FTP->new($Host, Timeout =3D> 360, Passive =3D> 'true') =
or
fail ();

$ftp->login($User,$Pass) or die " login '$ftp' failed: $_ ($^E)";
$ftp->binary;

foreach my $ddir ( [at] remotedir) {
if (! -d $ddir) {
print "mkpath $ddir\n" if $debug;
$ftp->mkpath ($ddir) or die "mkpath '$ddir' failed: $! ($^E)";
}
}
$ftp->cwd($data_dir);

# transfer data

print "Transfering data\n";

#my %numbers =3D ('$localdirs[0]' =3D> '0','localdirs[1]' =3D>
'1','localdirs[2]' =3D> '2');

my %remotedirs =3D ();
my $remotedirs;

foreach my $model ( [at] models) {

# define local and remote directories before copying files

if ($model eq 'arpege') {
my $remotedirs =3D "$data_dir/$models[0]/$dat0";
$remotedirs{$remotedirs} =3D $localdir[0];

} elsif ($model eq 'ukmo') {
my $remotedirs =3D "$data_dir/$models[1]/$dat0";
$remotedirs{$remotedirs} =3D $localdir[1];

} elsif ($model eq 'ecmf') {
my $remotedirs =3D "$data_dir/$models[2]/$dat0";
$remotedirs{$remotedirs} =3D $localdir[2];
}

# Transfer files

foreach my $rdir (keys %remotedirs) {
$ftp->cwd($remotedirs($rdir));

my $ldir =3D $remotedirs{$rdir}

print "Transfering files from $ldir to $remotedirs(rdir)\n" if
$debug;
opendir DIR, "$ldir" or die "opendir '$ldir: $! ($^E)";
while (my $file =3D readdir DIR) {
print "DIR";
exit;
next if $file =3D~ /\*(b|x|l)$/;
print "Putting $file\n" if $debug;
ftp->put($file) or warn "Failed '$file': $! ($^E)";
}
closedir DIR;

}
}

$ftp->close;
print "Transfering ends\n";
exit 0;

#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D
=3D=3D=3D=3D=3D
# Subroutines
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D
=3D=3D=3D=3D=3D

sub fail {

$ftp->quit;
die "ftp error occurred\n";

}


__END__

my $files =3D $ftp->dir() or die "Error doing ftp->dir: $!\n";
my $files =3D dir() or die "Error doing dir: $!\n";
foreach ( [at] $files) {
# skip lines not starting with d or -
if (/^[^d-]/) {
print "Skipping garbage dir line\n" if $debug;
next;
}

# ftp dir listing
#----0----- -1- ---2---- ---3---- ---4---- -5- -6 --7-- -----8--------
#total 52
#drwx--x--- 3 owner group 1024 Dec 13 1997 .
#drwxr-xr-x 671 owner group 49152 Dec 18 14:09 ..
#-rw-r--r-- 1 xyz httpd 2010 Sep 21 13:31 index.htm

my ($size, $file) =3D (split /\s+/, $_, 9)[4,8]; # get
size/filename
next if $file =3D~ /^\.{1,2}$/; # skip . and ..

# if directory - call directory recurse routine

if (/^d/) {
...


=09


------_=_NextPart_001_01CA88A6.D767EADA
Content-Type: text/html;
charset=us-ascii
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML dir=3Dltr><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2900.3636" name=3DGENERATOR>
<STYLE title=3DowaParaStyle>P {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</STYLE>
</HEAD>
<BODY ocsi=3D"x">
<DIV dir=3Dltr align=3Dleft><SPAN class=3D761053316-29122009><FONT =
face=3DArial
color=3D#0000ff size=3D2>Another bug, the "<STRONG>if (! -d =
$ddir)</STRONG>" command
in your highlighted foreach loop checks your local hard drive to =
see if the
directory exists, not the remote server you are connecting to, which is =
what I
assume you meant.</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D761053316-29122009><FONT =
face=3DArial
color=3D#0000ff size=3D2></FONT></SPAN> </DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D761053316-29122009><FONT =
face=3DArial
color=3D#0000ff size=3D2>I don't see a check if directory or file =
exists
command, so you'd have to cwd() to that dir & verify it succeeded, =
or parse
what's returned by list() or nlst().  If it failed, then you can =
assume the
directory doesn't exist.</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D761053316-29122009><FONT =
face=3DArial
color=3D#0000ff size=3D2></FONT></SPAN> </DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D761053316-29122009> <FONT =
face=3DArial
color=3D#0000ff size=3D2>As for your 2nd highlighted block, you said =
"ftp->put"
instead of "$ftp->put".  Makes a world of
difference.</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D761053316-29122009><FONT =
face=3DArial
color=3D#0000ff size=3D2></FONT></SPAN> </DIV>
<DIV dir=3Dltr align=3Dleft>
<HR tabIndex=3D-1>
</DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DTahoma size=3D2><B>From:</B>
activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] <B>On Behalf Of =
</B>Jeff
Saxton<BR><B>Sent:</B> Tuesday, December 29, 2009 6:45 AM<BR><B>To:</B> =
zilore
mumba; activeperl [at] listserv.activestate.com<BR><B>Subject:</B> RE: help =
with
ftp<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=3Dltr><FONT face=3DTahoma size=3D2>from the pod:</FONT></DIV>
<DIV dir=3Dltr><FONT face=3Dtahoma size=3D2></FONT> </DIV>
<DIV dir=3Dltr>
<DT><A name=3Dmkdir_(_DIR_[,_RECURSE_])>mkdir ( DIR [, RECURSE ])</A>
<DD>
<P>Create a new directory with the name <CODE>DIR</CODE>. If
<CODE>RECURSE</CODE> is <I>true</I> then <CODE>mkdir</CODE> will attempt =
to
create all the directories in the given path.</P></DD></DIV>
<P dir=3Dltr><FONT face=3D"times new roman"></FONT> </P>
<P dir=3Dltr> </P>
<DIV id=3DdivRpF981374 style=3D"DIRECTION: ltr">
<HR tabIndex=3D-1>
<FONT face=3DTahoma size=3D2><B>From:</B>
activeperl-bounces [at] listserv.ActiveState.com
[activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of zilore mumba
[zmumba [at] yahoo.com]<BR><B>Sent:</B> Tuesday, December 29, 2009 6:00
AM<BR><B>To:</B> activeperl [at] listserv.activestate.com<BR><B>Subject:</B> =
help
with ftp<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>
<TABLE cellSpacing=3D0 cellPadding=3D0 border=3D0>
<TBODY>
<TR>
<TD vAlign=3Dtop>Hello Perl Community.<BR>Thanks so much for all the =
help
provided lduring the current year.<BR>Happy and prosperous New =
Year 2010
to all.<BR><BR>Below is my code where I have a problem with ftp. I =
am
trying to transfer data from one PC to another. When I try to make =
a
directory on the distant machine, I get the error: "Can't locate =
object
method 'mkpath' via package 'ftp".<BR>When I comment this part =
out, the
same error appears later on with "ftp->put".<BR>Both parts with =
problem
are highlighted in yellow.<BR><BR>I am not able to find help in
Perldoc.<BR>Any help will be
appreciated<BR><BR>Zilore<BR><BR><BR>#!/usr/bin/perl -w<BR>#This =
transfers
files from a  PC running LINUX to Windows PC.<BR>#<BR>use
Net::FTP;<BR><BR>use strict;<BR>use warnings;<BR>use POSIX;<BR>use =

File::Path;<BR>use File::Copy;<BR><BR>my $debug =3D 1;<BR># set
variables<BR>#<BR>my $User =3D 'pc-mis';<BR>my $Pass =3D =
'acmad11';<BR>my
$Host =3D '192.168.2.115';<BR><BR>my [at] models =3D ('arpege', =
'ukmo',
'ecmf');<BR>my [at] now =3D localtime;<BR>my $dat =3D strftime =
"%Y%m%d",
[at] now;<BR>my $mon_ab =3D strftime "%b", [at] now;<BR>my $mon_num =3D =
strftime
"%m", [at] now;<BR>my $mon_name =3D strftime "%B", [at] now;<BR>my =
$yr=3Dstrftime
"%y", [at] now;<BR><BR>my $dash=3D"-";<BR>my $mod =3D =
"models";<BR><BR>my ($day,
$month, $year) =3D (localtime(time() - 60 * 60 * 24)) [ 3, 4, 5 =
];<BR>$year
=3D $year+1900;<BR>$month =3D $month+1;<BR><BR>my $dat0 =3D
sprintf("%04d%02d%02d",  $year, $month, $day );<BR><BR>my
$archive_dir =3D =
"../ARCHIVE/$mon_num$dash$mon_name$yr";   # where
data is<BR><BR>my $remote_basedir =3D '/';<BR>my $data_dir =3D
"ARCHIVE/$mon_num$dash$mon_name$yr/$mon_ab$yr$dash$mod"; #where to =
put
it<BR><BR>my [at] localdir
=
=3D("../ARCHIVE/$mon_num$dash$mon_name$yr/$models[0]/$dat0",<BR> &nb=
sp;           &nbs=
p;
=
"../ARCHIVE/$mon_num$dash$mon_name$yr/$models[1]/$dat0",<BR>  &=
nbsp;
          
"../ARCHIVE/$mon_num$dash$mon_name$yr/$models[2]/$dat0"); =
<BR><BR>#my
[at] remotedir =3D
=
('$data_dir/$models[0]/$dat0','$data_dir/$models[1]/$dat0',<BR># &nb=
sp;           &nbs=
p;  
'$data_dir/$models[2]/$dat0');<BR><BR># connect to the remote
host<BR><BR>print "Connecting to $Host ...\n";<BR>my $ftp =3D
Net::FTP->new($Host, Timeout =3D> 360, Passive =3D> =
'true') or fail
();<BR>    <BR>$ftp->login($User,$Pass) or die " =
login
'$ftp'  failed: $_ ($^E)";<BR>$ftp->binary;<BR><BR><SPAN
style=3D"BACKGROUND-COLOR: rgb(255,255,0)">foreach my $ddir =
( [at] remotedir)
{</SPAN><BR style=3D"BACKGROUND-COLOR: rgb(255,255,0)"><SPAN
style=3D"BACKGROUND-COLOR: rgb(255,255,0)">    if =
(! -d
$ddir) {</SPAN><BR style=3D"BACKGROUND-COLOR: =
rgb(255,255,0)"><SPAN
style=3D"BACKGROUND-COLOR: =
rgb(255,255,0)">       
print "mkpath $ddir\n" if $debug;</SPAN><BR
style=3D"BACKGROUND-COLOR: rgb(255,255,0)"><SPAN
style=3D"BACKGROUND-COLOR: =
rgb(255,255,0)">       
$ftp->mkpath ($ddir) or die "mkpath '$ddir' failed: $!
($^E)";</SPAN><BR style=3D"BACKGROUND-COLOR: rgb(255,255,0)"><SPAN =

style=3D"BACKGROUND-COLOR: rgb(255,255,0)">   =
}</SPAN><BR
style=3D"BACKGROUND-COLOR: rgb(255,255,0)"><SPAN
style=3D"BACKGROUND-COLOR: =
rgb(255,255,0)">}</SPAN><BR>$ftp->cwd($data_dir);<BR><BR>#
transfer data<BR><BR>print "Transfering data\n";<BR><BR>#my =
%numbers =3D
('$localdirs[0]' =3D> '0','localdirs[1]' =3D> =
'1','localdirs[2]' =3D>
'2');<BR><BR>my %remotedirs =3D ();<BR>my =
$remotedirs;<BR>   
<BR>foreach my $model ( [at] models) {<BR><BR>    # =
define local
and remote directories before copying =
files<BR><BR>    if
($model eq 'arpege') {<BR>     my $remotedirs =
=3D
"$data_dir/$models[0]/$dat0";<BR>      
$remotedirs{$remotedirs} =3D $localdir[0];<BR><BR>  } elsif =
($model eq
'ukmo') {<BR>     my $remotedirs =3D
=
"$data_dir/$models[1]/$dat0";<BR>      
$remotedirs{$remotedirs} =3D $localdir[1];<BR><BR>  } elsif =
($model eq
'ecmf') {<BR>     my $remotedirs =3D
=
"$data_dir/$models[2]/$dat0";<BR>      
$remotedirs{$remotedirs} =3D $localdir[2];<BR>  }<BR> 
<BR>    # Transfer files<BR><BR>    =
foreach
my $rdir (keys %remotedirs) {<BR>   
=
 $ftp->cwd($remotedirs($rdir));<BR><BR>     =
my
$ldir =3D $remotedirs{$rdir}<BR>    
<BR>     print "Transfering files from $ldir =
to
$remotedirs(rdir)\n" if $debug;<BR>     =
opendir DIR,
"$ldir" or die "opendir '$ldir: $! =
($^E)";<BR>    
while (my $file =3D readdir DIR)
{<BR>        print
"DIR";<BR>       
exit;<BR>        next if $file =
=3D~
/\*(b|x|l)$/;<BR>        print =
"Putting
$file\n" if $debug;<BR>        =
<SPAN
style=3D"BACKGROUND-COLOR: rgb(255,255,0)">ftp->put($file) or =
warn
"Failed '$file': $! ($^E)";</SPAN><BR>    
}<BR>     closedir DIR;<BR> 
<BR>    }<BR>}<BR><BR>$ftp->close;<BR>print =
"Transfering
ends\n";<BR>exit
=
0;<BR><BR> #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D<BR>#         =
;            =
          
=
Subroutines<BR>#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D<BR><BR>sub
fail {<BR><BR>$ftp->quit;<BR>die "ftp error
occurred\n";<BR><BR>}<BR><BR><BR>__END__<BR><BR>my $files =3D =
$ftp->dir()
or die "Error doing ftp->dir: $!\n";<BR>my $files =3D dir() or =
die "Error
doing dir: $!\n";<BR>foreach ( [at] $files) {<BR>    # =
skip
lines not starting with d or -<BR>    if (/^[^d-]/) =

{<BR>         print =
"Skipping
garbage dir line\n" if
$debug;<BR>       
next;<BR>    }<BR><BR># ftp dir =
listing<BR>#----0----- -1-
---2---- ---3---- ---4---- -5- -6 --7-- -----8--------<BR>#total
52<BR>#drwx--x---   3 owner   
group        1024 Dec 13  =
1997
.<BR>#drwxr-xr-x 671 owner   
group       49152 Dec 18 14:09
..<BR>#-rw-r--r--   1 xyz     
httpd        2010 Sep 21 13:31
index.htm<BR><BR>    my ($size, $file) =3D (split =
/\s+/, $_,
9)[4,8];    # get =
size/filename<BR>    next
if $file =3D~ =
/^\.{1,2}$/;        # skip
. and ..<BR><BR>    # if directory - call directory =
recurse
routine<BR><BR>    if (/^d/)
{<BR>       
...<BR><BR><BR></TD></TR></TBODY></TABLE><BR></DIV></BODY></HTML>

------_=_NextPart_001_01CA88A6.D767EADA--


--===============1653116433==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1653116433==--
Curtis Leach [ Di, 29 Dezember 2009 17:48 ] [ ID #2027371 ]

RE: help with ftp

--===============1588562040==
Content-Type: multipart/alternative; boundary="0-562042941-1262106895=:17804"

--0-562042941-1262106895=:17804
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Jeff,
Thanks very much for the hint. With mkdir it actually created the directori=
es once but had a problem with put.
When I rerun it it fails again at mkdir. (incidentally I do not know what v=
alue to put in for RECURSE. when I type RECURSE it gives of a breword RECUR=
SE).
Thanks for sparing your time.
Zilore



--- On Tue, 12/29/09, Jeff Saxton <jeff_saxton [at] bigfix.com> wrote:

From: Jeff Saxton <jeff_saxton [at] bigfix.com>
Subject: RE: help with ftp
To: "zilore mumba" <zmumba [at] yahoo.com>, "activeperl [at] listserv.activestate.com=
" <activeperl [at] listserv.activestate.com>
Date: Tuesday, December 29, 2009, 4:45 PM

=0A =0A =0A=0Afrom the pod:=0A=A0=0Amkdir ( DIR [, RECURSE ])=0A=0ACreate a=
new directory with the name DIR. If RECURSE is=0Atrue then mkdir will atte=
mpt to create all the directories in the given path.=0A=0A=A0=0A=A0=0A=0A=
=0AFrom: activeperl-bounces [at] listserv.ActiveState.com [activeperl-bounces [at] li=
stserv.ActiveState.com] On Behalf Of zilore mumba [zmumba [at] yahoo.com]
=0ASent: Tuesday, December 29, 2009 6:00 AM
=0ATo: activeperl [at] listserv.activestate.com
=0ASubject: help with ftp
=0A
=0A=0A=0A=0A=0A=0A=0AHello Perl Community.
=0AThanks so much for all the help provided lduring the current year.
=0AHappy and prosperous New Year 2010 to all.
=0A
=0ABelow is my code where I have a problem with ftp. I am trying to transfe=
r data from one PC to another. When I try to make a directory on the distan=
t machine, I get the error: "Can't locate object method 'mkpath' via packag=
e 'ftp".
=0AWhen I comment this part out, the same error appears later on with "ftp-=
>put".
=0ABoth parts with problem are highlighted in yellow.
=0A
=0AI am not able to find help in Perldoc.
=0AAny help will be appreciated
=0A
=0AZilore
=0A
=0A
=0A#!/usr/bin/perl -w
=0A#This transfers files from a=A0 PC running LINUX to Windows PC.
=0A#
=0Ause Net::FTP;
=0A
=0Ause strict;
=0Ause warnings;
=0Ause POSIX;
=0Ause File::Path;
=0Ause File::Copy;
=0A
=0Amy $debug =3D 1;
=0A# set variables
=0A#
=0Amy $User =3D 'pc-mis';
=0Amy $Pass =3D 'acmad11';
=0Amy $Host =3D '192.168.2.115';
=0A
=0Amy [at] models =3D ('arpege', 'ukmo', 'ecmf');
=0Amy [at] now =3D localtime;
=0Amy $dat =3D strftime "%Y%m%d", [at] now;
=0Amy $mon_ab =3D strftime "%b", [at] now;
=0Amy $mon_num =3D strftime "%m", [at] now;
=0Amy $mon_name =3D strftime "%B", [at] now;
=0Amy $yr=3Dstrftime "%y", [at] now;
=0A
=0Amy $dash=3D"-";
=0Amy $mod =3D "models";
=0A
=0Amy ($day, $month, $year) =3D (localtime(time() - 60 * 60 * 24)) [ 3, 4, =
5 ];
=0A$year =3D $year+1900;
=0A$month =3D $month+1;
=0A
=0Amy $dat0 =3D sprintf("%04d%02d%02d",=A0 $year, $month, $day );
=0A
=0Amy $archive_dir =3D "../ARCHIVE/$mon_num$dash$mon_name$yr";=A0=A0 # wher=
e data is
=0A
=0Amy $remote_basedir =3D '/';
=0Amy $data_dir =3D "ARCHIVE/$mon_num$dash$mon_name$yr/$mon_ab$yr$dash$mod"=
; #where to put it
=0A
=0Amy [at] localdir =3D("../ARCHIVE/$mon_num$dash$mon_name$yr/$models[0]/$dat0"=
,
=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 "../ARCHIVE/$mon_num$dash$mon=
_name$yr/$models[1]/$dat0",
=0A=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0 "../ARCHIVE/$mon_num$dash$mon_name$=
yr/$models[2]/$dat0");
=0A
=0A#my [at] remotedir =3D ('$data_dir/$models[0]/$dat0','$data_dir/$models[1]/$=
dat0',
=0A#=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 '$data_dir/$models[2]/=
$dat0');
=0A
=0A# connect to the remote host
=0A
=0Aprint "Connecting to $Host ...\n";
=0Amy $ftp =3D Net::FTP->new($Host, Timeout =3D> 360, Passive =3D> 'true') =
or fail ();
=0A=A0=A0=A0
=0A$ftp->login($User,$Pass) or die " login '$ftp'=A0 failed: $_ ($^E)";
=0A$ftp->binary;
=0A
=0Aforeach my $ddir ( [at] remotedir) {
=0A=A0=A0=A0 if (! -d $ddir) {
=0A=A0=A0=A0=A0=A0=A0=A0 print "mkpath $ddir\n" if $debug;
=0A=A0=A0=A0=A0=A0=A0=A0 $ftp->mkpath ($ddir) or die "mkpath '$ddir' failed=
: $! ($^E)";
=0A=A0=A0 }
=0A}
=0A$ftp->cwd($data_dir);
=0A
=0A# transfer data
=0A
=0Aprint "Transfering data\n";
=0A
=0A#my %numbers =3D ('$localdirs[0]' =3D> '0','localdirs[1]' =3D> '1','loca=
ldirs[2]' =3D> '2');
=0A
=0Amy %remotedirs =3D ();
=0Amy $remotedirs;
=0A=A0=A0=A0
=0Aforeach my $model ( [at] models) {
=0A
=0A=A0=A0=A0 # define local and remote directories before copying files
=0A
=0A=A0=A0=A0 if ($model eq 'arpege') {
=0A=A0=A0=A0=A0 my $remotedirs =3D "$data_dir/$models[0]/$dat0";
=0A=A0=A0=A0 =A0=A0 $remotedirs{$remotedirs} =3D $localdir[0];
=0A
=0A=A0 } elsif ($model eq 'ukmo') {
=0A=A0=A0=A0=A0 my $remotedirs =3D "$data_dir/$models[1]/$dat0";
=0A=A0=A0=A0=A0=A0=A0 $remotedirs{$remotedirs} =3D $localdir[1];
=0A
=0A=A0 } elsif ($model eq 'ecmf') {
=0A=A0=A0=A0=A0 my $remotedirs =3D "$data_dir/$models[2]/$dat0";
=0A=A0=A0=A0=A0=A0=A0 $remotedirs{$remotedirs} =3D $localdir[2];
=0A=A0 }
=0A=A0
=0A=A0=A0=A0 # Transfer files
=0A
=0A=A0=A0=A0 foreach my $rdir (keys %remotedirs) {
=0A=A0=A0=A0 =A0$ftp->cwd($remotedirs($rdir));
=0A
=0A=A0=A0=A0=A0 my $ldir =3D $remotedirs{$rdir}
=0A=A0=A0=A0=A0
=0A=A0=A0=A0 =A0print "Transfering files from $ldir to $remotedirs(rdir)\n"=
if $debug;
=0A=A0=A0=A0=A0 opendir DIR, "$ldir" or die "opendir '$ldir: $! ($^E)";
=0A=A0=A0=A0=A0 while (my $file =3D readdir DIR) {
=0A=A0=A0=A0=A0=A0=A0=A0 print "DIR";
=0A=A0=A0=A0=A0=A0=A0=A0 exit;
=0A=A0=A0=A0=A0=A0=A0=A0 next if $file =3D~ /\*(b|x|l)$/;
=0A=A0=A0=A0=A0=A0=A0=A0 print "Putting $file\n" if $debug;
=0A=A0=A0=A0=A0=A0=A0=A0 ftp->put($file) or warn "Failed '$file': $! ($^E)"=
;
=0A=A0=A0=A0=A0 }
=0A=A0=A0=A0=A0 closedir DIR;
=0A=A0
=0A=A0=A0=A0 }
=0A}
=0A
=0A$ftp->close;
=0Aprint "Transfering ends\n";
=0Aexit 0;
=0A
=0A#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D
=0A#=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A 0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0 Subroutines
=0A#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D
=0A
=0Asub fail {
=0A
=0A$ftp->quit;
=0Adie "ftp error occurred\n";
=0A
=0A}
=0A
=0A
=0A__END__
=0A
=0Amy $files =3D $ftp->dir() or die "Error doing ftp->dir: $!\n";
=0Amy $files =3D dir() or die "Error doing dir: $!\n";
=0Aforeach ( [at] $files) {
=0A=A0=A0=A0 # skip lines not starting with d or -
=0A=A0=A0=A0 if (/^[^d-]/) {
=0A=A0=A0=A0=A0=A0=A0=A0=A0 print "Skipping garbage dir line\n" if $debug;
=0A=A0=A0=A0=A0=A0=A0=A0 next;
=0A=A0=A0=A0 }
=0A
=0A# ftp dir listing
=0A#----0----- -1- ---2---- ---3---- ---4---- -5- -6 --7-- -----8--------
=0A#total 52
=0A#drwx--x---=A0=A0 3 owner=A0=A0=A0 group=A0=A0=A0=A0=A0=A0=A0 1024 Dec 1=
3=A0 1997 .
=0A#drwxr-xr-x 671 owner=A0=A0=A0 group=A0=A0=A0=A0=A0=A0 49152 Dec 18 14:0=
9 ..
=0A#-rw-r--r--=A0=A0 1 xyz=A0=A0=A0=A0=A0 httpd=A0=A0=A0=A0=A0=A0=A0 2010 S=
ep 21 13:31 index.htm
=0A
=0A=A0=A0=A0 my ($size, $file) =3D (split /\s+/, $_, 9)[4,8];=A0=A0=A0 # ge=
t size/filename
=0A=A0=A0=A0 next if $file =3D~ /^\.{1,2}$/;=A0=A0=A0=A0=A0=A0=A0 # skip . =
and ..
=0A
=0A=A0=A0=A0 # if directory - call directory recurse routine
=0A
=0A=A0=A0=A0 if (/^d/) {
=0A=A0=A0=A0=A0=A0=A0=A0 ...
=0A
=0A
=0A=0A=0A=0A=0A
=0A=0A =0A=0A=0A=0A
--0-562042941-1262106895=:17804
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0" ><tr><td valign=3D"=
top" style=3D"font: inherit;">Jeff,<br>Thanks very much for the hint. With =
mkdir it actually created the directories once but had a problem with put. =
<br>When I rerun it it fails again at mkdir. (incidentally I do not know wh=
at value to put in for RECURSE. when I type RECURSE it gives of a breword R=
ECURSE).<br>Thanks for sparing your time.<br>Zilore<br><br><br><br>--- On <=
b>Tue, 12/29/09, Jeff Saxton <i><jeff_saxton [at] bigfix.com></i></b> wrot=
e:<br><blockquote style=3D"border-left: 2px solid rgb(16, 16, 255); margin-=
left: 5px; padding-left: 5px;"><br>From: Jeff Saxton <jeff_saxton [at] bigfix=
..com><br>Subject: RE: help with ftp<br>To: "zilore mumba" <zmumba [at] yah=
oo.com>, "activeperl [at] listserv.activestate.com" <activeperl [at] listserv.a=
ctivestate.com><br>Date: Tuesday, December 29, 2009, 4:45 PM<br><br><div=
id=3D"yiv959726055">=0A =0A =0A<style><!--#yiv959726055 P {=0AMARGIN-TOP:0=
px;MARGIN-BOTTOM:0px;}=0A--></style>=0A<div dir=3D"ltr"><font color=3D"#000=
000" face=3D"Tahoma" size=3D"2">from the pod:</font></div>=0A<div dir=3D"lt=
r"><font face=3D"tahoma" size=3D"2"></font> </div>=0A<div dir=3D"ltr">=
<dt><a rel=3D"nofollow">mkdir ( DIR [, RECURSE ])</a>=0A</dt><dd>=0A<p>Crea=
te a new directory with the name <code>DIR</code>. If <code>RECURSE</code> =
is=0A<i>true</i> then <code>mkdir</code> will attempt to create all the dir=
ectories in the given path.</p>=0A</dd></div>=0A<p dir=3D"ltr"><font face=
=3D"times new roman"></font> </p>=0A<p dir=3D"ltr"> </p>=0A<div i=
d=3D"divRpF981374" style=3D"direction: ltr;">=0A<hr tabindex=3D"-1">=0A<fon=
t face=3D"Tahoma" size=3D"2"><b>From:</b> activeperl-bounces [at] listserv.Activ=
eState.com [activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of zilor=
e mumba [zmumba [at] yahoo.com]<br>=0A<b>Sent:</b> Tuesday, December 29, 2009 6:=
00 AM<br>=0A<b>To:</b> activeperl [at] listserv.activestate.com<br>=0A<b>Subject=
:</b> help with ftp<br>=0A</font><br>=0A</div>=0A<div></div>=0A<div>=0A<tab=
le border=3D"0" cellpadding=3D"0" cellspacing=3D"0">=0A<tbody>=0A<tr>=0A<td=
valign=3D"top">Hello Perl Community.<br>=0AThanks so much for all the help=
provided lduring the current year.<br>=0AHappy and prosperous New Year 201=
0 to all.<br>=0A<br>=0ABelow is my code where I have a problem with ftp. I =
am trying to transfer data from one PC to another. When I try to make a dir=
ectory on the distant machine, I get the error: "Can't locate object method=
'mkpath' via package 'ftp".<br>=0AWhen I comment this part out, the same e=
rror appears later on with "ftp->put".<br>=0ABoth parts with problem are=
highlighted in yellow.<br>=0A<br>=0AI am not able to find help in Perldoc.=
<br>=0AAny help will be appreciated<br>=0A<br>=0AZilore<br>=0A<br>=0A<br>=
=0A#!/usr/bin/perl -w<br>=0A#This transfers files from a  PC running L=
INUX to Windows PC.<br>=0A#<br>=0Ause Net::FTP;<br>=0A<br>=0Ause strict;<br=
>=0Ause warnings;<br>=0Ause POSIX;<br>=0Ause File::Path;<br>=0Ause File::Co=
py;<br>=0A<br>=0Amy $debug =3D 1;<br>=0A# set variables<br>=0A#<br>=0Amy $U=
ser =3D 'pc-mis';<br>=0Amy $Pass =3D 'acmad11';<br>=0Amy $Host =3D '192.168=
..2.115';<br>=0A<br>=0Amy [at] models =3D ('arpege', 'ukmo', 'ecmf');<br>=0Amy [at] =
now =3D localtime;<br>=0Amy $dat =3D strftime "%Y%m%d", [at] now;<br>=0Amy $mon=
_ab =3D strftime "%b", [at] now;<br>=0Amy $mon_num =3D strftime "%m", [at] now;<br>=
=0Amy $mon_name =3D strftime "%B", [at] now;<br>=0Amy $yr=3Dstrftime "%y", [at] now;<=
br>=0A<br>=0Amy $dash=3D"-";<br>=0Amy $mod =3D "models";<br>=0A<br>=0Amy ($=
day, $month, $year) =3D (localtime(time() - 60 * 60 * 24)) [ 3, 4, 5 ];<br>=
=0A$year =3D $year+1900;<br>=0A$month =3D $month+1;<br>=0A<br>=0Amy $dat0 =
=3D sprintf("%04d%02d%02d",  $year, $month, $day );<br>=0A<br>=0Amy $a=
rchive_dir =3D "../ARCHIVE/$mon_num$dash$mon_name$yr";   # where =
data is<br>=0A<br>=0Amy $remote_basedir =3D '/';<br>=0Amy $data_dir =3D "AR=
CHIVE/$mon_num$dash$mon_name$yr/$mon_ab$yr$dash$mod"; #where to put it<br>=
=0A<br>=0Amy [at] localdir =3D("../ARCHIVE/$mon_num$dash$mon_name$yr/$models[0]=
/$dat0",<br>=0A          =
     "../ARCHIVE/$mon_num$dash$mon_name$yr/$models[1]/$=
dat0",<br>=0A             =
;  "../ARCHIVE/$mon_num$dash$mon_name$yr/$models[2]/$dat0"); <br>=0A<b=
r>=0A#my [at] remotedir =3D ('$data_dir/$models[0]/$dat0','$data_dir/$models[1]=
/$dat0',<br>=0A#          =
;       '$data_dir/$models[2]/$dat0');<br>=0A=
<br>=0A# connect to the remote host<br>=0A<br>=0Aprint "Connecting to $Host=
...\n";<br>=0Amy $ftp =3D Net::FTP->new($Host, Timeout =3D> 360, Pas=
sive =3D> 'true') or fail ();<br>=0A    <br>=0A$ftp->l=
ogin($User,$Pass) or die " login '$ftp'  failed: $_ ($^E)";<br>=0A$ftp=
->binary;<br>=0A<br>=0A<span style=3D"background-color: rgb(255, 255, 0)=
;">foreach my $ddir ( [at] remotedir) {</span><br style=3D"background-color: rgb=
(255, 255, 0);">=0A<span style=3D"background-color: rgb(255, 255, 0);">&nbs=
p;   if (! -d $ddir) {</span><br style=3D"background-color: rgb(2=
55, 255, 0);">=0A<span style=3D"background-color: rgb(255, 255, 0);"> =
       print "mkpath $ddir\n" if $debug;</spa=
n><br style=3D"background-color: rgb(255, 255, 0);">=0A<span style=3D"backg=
round-color: rgb(255, 255, 0);">        =
$ftp->mkpath ($ddir) or die "mkpath '$ddir' failed: $! ($^E)";</span><br=
style=3D"background-color: rgb(255, 255, 0);">=0A<span style=3D"background=
-color: rgb(255, 255, 0);">   }</span><br style=3D"background-col=
or: rgb(255, 255, 0);">=0A<span style=3D"background-color: rgb(255, 255, 0)=
;">}</span><br>=0A$ftp->cwd($data_dir);<br>=0A<br>=0A# transfer data<br>=
=0A<br>=0Aprint "Transfering data\n";<br>=0A<br>=0A#my %numbers =3D ('$loca=
ldirs[0]' =3D> '0','localdirs[1]' =3D> '1','localdirs[2]' =3D> '2'=
);<br>=0A<br>=0Amy %remotedirs =3D ();<br>=0Amy $remotedirs;<br>=0A &n=
bsp;  <br>=0Aforeach my $model ( [at] models) {<br>=0A<br>=0A  &n=
bsp; # define local and remote directories before copying files<br>=0A<br>=
=0A    if ($model eq 'arpege') {<br>=0A   &nb=
sp; my $remotedirs =3D "$data_dir/$models[0]/$dat0";<br>=0A  &nbs=
p;    $remotedirs{$remotedirs} =3D $localdir[0];<br>=0A<br>=0A&nb=
sp; } elsif ($model eq 'ukmo') {<br>=0A     my $remoted=
irs =3D "$data_dir/$models[1]/$dat0";<br>=0A     &=
nbsp; $remotedirs{$remotedirs} =3D $localdir[1];<br>=0A<br>=0A  } elsi=
f ($model eq 'ecmf') {<br>=0A     my $remotedirs =3D "$=
data_dir/$models[2]/$dat0";<br>=0A       $rem=
otedirs{$remotedirs} =3D $localdir[2];<br>=0A  }<br>=0A  <br>=0A&=
nbsp;   # Transfer files<br>=0A<br>=0A    foreach =
my $rdir (keys %remotedirs) {<br>=0A     $ftp->cwd($=
remotedirs($rdir));<br>=0A<br>=0A     my $ldir =3D $rem=
otedirs{$rdir}<br>=0A     <br>=0A    &nb=
sp;print "Transfering files from $ldir to $remotedirs(rdir)\n" if $debug;<b=
r>=0A     opendir DIR, "$ldir" or die "opendir '$ldir: =
$! ($^E)";<br>=0A     while (my $file =3D readdir DIR) =
{<br>=0A        print "DIR";<br>=0A =
;       exit;<br>=0A    &=
nbsp;   next if $file =3D~ /\*(b|x|l)$/;<br>=0A   =
     print "Putting $file\n" if $debug;<br>=0A &nb=
sp;      <span style=3D"background-color: rgb(255,=
255, 0);">ftp->put($file) or warn "Failed '$file': $! ($^E)";</span><br=
>=0A     }<br>=0A     closedir DIR;=
<br>=0A  <br>=0A    }<br>=0A}<br>=0A<br>=0A$ftp->clo=
se;<br>=0Aprint "Transfering ends\n";<br>=0Aexit 0;<br>=0A<br>=0A#=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D<br>=
=0A#            =
;            &n=
bsp;       Subroutines<br>=0A#=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D<br>=0A<br>=
=0Asub fail {<br>=0A<br>=0A$ftp->quit;<br>=0Adie "ftp error occurred\n";=
<br>=0A<br>=0A}<br>=0A<br>=0A<br>=0A__END__<br>=0A<br>=0Amy $files =3D $ftp=
->dir() or die "Error doing ftp->dir: $!\n";<br>=0Amy $files =3D dir(=
) or die "Error doing dir: $!\n";<br>=0Aforeach ( [at] $files) {<br>=0A &nb=
sp;  # skip lines not starting with d or -<br>=0A    if=
(/^[^d-]/) {<br>=0A         print =
"Skipping garbage dir line\n" if $debug;<br>=0A    &nbs=
p;   next;<br>=0A    }<br>=0A<br>=0A# ftp dir list=
ing<br>=0A#----0----- -1- ---2---- ---3---- ---4---- -5- -6 --7-- -----8---=
-----<br>=0A#total 52<br>=0A#drwx--x---   3 owner  &nbs=
p; group        1024 Dec 13  1997 .=
<br>=0A#drwxr-xr-x 671 owner    group    =
;   49152 Dec 18 14:09 ..<br>=0A#-rw-r--r--   1 xyz&nbs=
p;     httpd        =
2010 Sep 21 13:31 index.htm<br>=0A<br>=0A    my ($size, $fil=
e) =3D (split /\s+/, $_, 9)[4,8];    # get size/filename<br>=
=0A    next if $file =3D~ /^\.{1,2}$/;   &nbs=
p;    # skip . and ..<br>=0A<br>=0A    # if d=
irectory - call directory recurse routine<br>=0A<br>=0A    i=
f (/^d/) {<br>=0A        ...<br>=0A<br>=
=0A<br>=0A</td>=0A</tr>=0A</tbody>=0A</table>=0A<br>=0A</div>=0A =0A</div><=
/blockquote></td></tr></table><br>=0A=0A=0A=0A
--0-562042941-1262106895=:17804--

--===============1588562040==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1588562040==--
zilore mumba [ Di, 29 Dezember 2009 18:14 ] [ ID #2027372 ]

RE: help with ftp

--===============1550139607==
Content-Language: en-US
Content-Type: multipart/alternative;
boundary="_000_6DFE695E783E004A9E6D2CD1E0B8CA1F0BEF0A1302bma il2bigfixc_"

--_000_6DFE695E783E004A9E6D2CD1E0B8CA1F0BEF0A1302bmail2bigfi xc_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Recurse is probably a Boolean i.e. 0|1

Your put is failing because you're doing ftp->put not $ftp->put


________________________________
From: zilore mumba [mailto:zmumba [at] yahoo.com]
Sent: Tuesday, December 29, 2009 9:15 AM
To: activeperl [at] listserv.activestate.com; Jeff Saxton
Subject: RE: help with ftp

Jeff,
Thanks very much for the hint. With mkdir it actually created the directori=
es once but had a problem with put.
When I rerun it it fails again at mkdir. (incidentally I do not know what v=
alue to put in for RECURSE. when I type RECURSE it gives of a breword RECUR=
SE).
Thanks for sparing your time.
Zilore



--- On Tue, 12/29/09, Jeff Saxton <jeff_saxton [at] bigfix.com> wrote:

From: Jeff Saxton <jeff_saxton [at] bigfix.com>
Subject: RE: help with ftp
To: "zilore mumba" <zmumba [at] yahoo.com>, "activeperl [at] listserv.activestate.com=
" <activeperl [at] listserv.activestate.com>
Date: Tuesday, December 29, 2009, 4:45 PM
from the pod:

mkdir ( DIR [, RECURSE ])

Create a new directory with the name DIR. If RECURSE is true then mkdir wil=
l attempt to create all the directories in the given path.





________________________________
From: activeperl-bounces [at] listserv.ActiveState.com [activeperl-bounces [at] lists=
erv.ActiveState.com] On Behalf Of zilore mumba [zmumba [at] yahoo.com]
Sent: Tuesday, December 29, 2009 6:00 AM
To: activeperl [at] listserv.activestate.com
Subject: help with ftp
Hello Perl Community.
Thanks so much for all the help provided lduring the current year.
Happy and prosperous New Year 2010 to all.

Below is my code where I have a problem with ftp. I am trying to transfer d=
ata from one PC to another. When I try to make a directory on the distant m=
achine, I get the error: "Can't locate object method 'mkpath' via package '=
ftp".
When I comment this part out, the same error appears later on with "ftp->pu=
t".
Both parts with problem are highlighted in yellow.

I am not able to find help in Perldoc.
Any help will be appreciated

Zilore


#!/usr/bin/perl -w
#This transfers files from a PC running LINUX to Windows PC.
#
use Net::FTP;

use strict;
use warnings;
use POSIX;
use File::Path;
use File::Copy;

my $debug =3D 1;
# set variables
#
my $User =3D 'pc-mis';
my $Pass =3D 'acmad11';
my $Host =3D '192.168.2.115';

my [at] models =3D ('arpege', 'ukmo', 'ecmf');
my [at] now =3D localtime;
my $dat =3D strftime "%Y%m%d", [at] now;
my $mon_ab =3D strftime "%b", [at] now;
my $mon_num =3D strftime "%m", [at] now;
my $mon_name =3D strftime "%B", [at] now;
my $yr=3Dstrftime "%y", [at] now;

my $dash=3D"-";
my $mod =3D "models";

my ($day, $month, $year) =3D (localtime(time() - 60 * 60 * 24)) [ 3, 4, 5 ]=
;
$year =3D $year+1900;
$month =3D $month+1;

my $dat0 =3D sprintf("%04d%02d%02d", $year, $month, $day );

my $archive_dir =3D "../ARCHIVE/$mon_num$dash$mon_name$yr"; # where data =
is

my $remote_basedir =3D '/';
my $data_dir =3D "ARCHIVE/$mon_num$dash$mon_name$yr/$mon_ab$yr$dash$mod"; #=
where to put it

my [at] localdir =3D("../ARCHIVE/$mon_num$dash$mon_name$yr/$models[0]/$dat0",
"../ARCHIVE/$mon_num$dash$mon_name$yr/$models[1]/$dat0",
"../ARCHIVE/$mon_num$dash$mon_name$yr/$models[2]/$dat0");

#my [at] remotedir =3D ('$data_dir/$models[0]/$dat0','$data_dir/$models[1]/$dat=
0',
# '$data_dir/$models[2]/$dat0');

# connect to the remote host

print "Connecting to $Host ...\n";
my $ftp =3D Net::FTP->new($Host, Timeout =3D> 360, Passive =3D> 'true') or =
fail ();

$ftp->login($User,$Pass) or die " login '$ftp' failed: $_ ($^E)";
$ftp->binary;

foreach my $ddir ( [at] remotedir) {
if (! -d $ddir) {
print "mkpath $ddir\n" if $debug;
$ftp->mkpath ($ddir) or die "mkpath '$ddir' failed: $! ($^E)";
}
}
$ftp->cwd($data_dir);

# transfer data

print "Transfering data\n";

#my %numbers =3D ('$localdirs[0]' =3D> '0','localdirs[1]' =3D> '1','localdi=
rs[2]' =3D> '2');

my %remotedirs =3D ();
my $remotedirs;

foreach my $model ( [at] models) {

# define local and remote directories before copying files

if ($model eq 'arpege') {
my $remotedirs =3D "$data_dir/$models[0]/$dat0";
$remotedirs{$remotedirs} =3D $localdir[0];

} elsif ($model eq 'ukmo') {
my $remotedirs =3D "$data_dir/$models[1]/$dat0";
$remotedirs{$remotedirs} =3D $localdir[1];

} elsif ($model eq 'ecmf') {
my $remotedirs =3D "$data_dir/$models[2]/$dat0";
$remotedirs{$remotedirs} =3D $localdir[2];
}

# Transfer files

foreach my $rdir (keys %remotedirs) {
$ftp->cwd($remotedirs($rdir));

my $ldir =3D $remotedirs{$rdir}

print "Transfering files from $ldir to $remotedirs(rdir)\n" if $debug;
opendir DIR, "$ldir" or die "opendir '$ldir: $! ($^E)";
while (my $file =3D readdir DIR) {
print "DIR";
exit;
next if $file =3D~ /\*(b|x|l)$/;
print "Putting $file\n" if $debug;
ftp->put($file) or warn "Failed '$file': $! ($^E)";
}
closedir DIR;

}
}

$ftp->close;
print "Transfering ends\n";
exit 0;

#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D
# Subroutines
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D

sub fail {

$ftp->quit;
die "ftp error occurred\n";

}


__END__

my $files =3D $ftp->dir() or die "Error doing ftp->dir: $!\n";
my $files =3D dir() or die "Error doing dir: $!\n";
foreach ( [at] $files) {
# skip lines not starting with d or -
if (/^[^d-]/) {
print "Skipping garbage dir line\n" if $debug;
next;
}

# ftp dir listing
#----0----- -1- ---2---- ---3---- ---4---- -5- -6 --7-- -----8--------
#total 52
#drwx--x--- 3 owner group 1024 Dec 13 1997 .
#drwxr-xr-x 671 owner group 49152 Dec 18 14:09 ..
#-rw-r--r-- 1 xyz httpd 2010 Sep 21 13:31 index.htm

my ($size, $file) =3D (split /\s+/, $_, 9)[4,8]; # get size/filename
next if $file =3D~ /^\.{1,2}$/; # skip . and ..

# if directory - call directory recurse routine

if (/^d/) {
...





--_000_6DFE695E783E004A9E6D2CD1E0B8CA1F0BEF0A1302bmail2bigfi xc_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" xmlns=3D"http://ww=
w.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
..shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" name=3D"Person=
Name"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p
{mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman";}
code
{font-family:"Courier New";}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
[at] page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span style=
=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Recurse is probably a Boolean i.e. 0|1=
<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span style=
=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span style=
=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Your put is failing because you’=
re
doing ftp->put not $ftp->put<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span style=
=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span style=
=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<div>

<div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><font siz=
e=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>

<hr size=3D2 width=3D"100%" align=3Dcenter tabindex=3D-1>

</span></font></div>

<p class=3DMsoNormal><b><font size=3D2 face=3DTahoma><span style=3D'font-si=
ze:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=3D2
face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'> zilore m=
umba
[mailto:zmumba [at] yahoo.com] <br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> Tuesday, December 29, =
2009
9:15 AM<br>
<b><span style=3D'font-weight:bold'>To:</span></b>
activeperl [at] listserv.activestate.com; <st1:PersonName w:st=3D"on">Jeff Saxto=
n</st1:PersonName><br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> RE: help with ftp</=
span></font><o:p></o:p></p>

</div>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span style=3D=
'font-size:
12.0pt'><o:p> </o:p></span></font></p>

<table class=3DMsoNormalTable border=3D0 cellspacing=3D0 cellpadding=3D0>
<tr>
<td valign=3Dtop style=3D'padding:0in 0in 0in 0in'>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>Jeff,<br>
Thanks very much for the hint. With mkdir it actually created the directo=
ries
once but had a problem with put. <br>
When I rerun it it fails again at mkdir. (incidentally I do not know what
value to put in for RECURSE. when I type RECURSE it gives of a breword
RECURSE).<br>
Thanks for sparing your time.<br>
Zilore<br>
<br>
<br>
<br>
--- On <b><span style=3D'font-weight:bold'>Tue, 12/29/09, <st1:PersonName
w:st=3D"on">Jeff Saxton</st1:PersonName> <i><span style=3D'font-style:ita=
lic'><jeff_saxton [at] bigfix.com></span></i></span></b>
wrote:<o:p></o:p></span></font></p>
<p class=3DMsoNormal style=3D'margin-bottom:12.0pt'><font size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'><br>
From: <st1:PersonName w:st=3D"on">Jeff Saxton</st1:PersonName>
<jeff_saxton [at] bigfix.com><br>
Subject: RE: help with ftp<br>
To: "zilore mumba" <zmumba [at] yahoo.com>,
"activeperl [at] listserv.activestate.com"
<activeperl [at] listserv.activestate.com><br>
Date: Tuesday, December 29, 2009, 4:45 PM<o:p></o:p></span></font></p>
<div id=3Dyiv959726055>
<div>
<p class=3DMsoNormal><font size=3D2 color=3Dblack face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma;color:black'>fr om the pod:</=
span></font><o:p></o:p></p>
</div>
<div>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'> <o:p></o:p></span></font></p>
</div>
<div>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>mkdir ( DIR [, RECURSE ]) <o:p></o:p></span></=
font></p>
<p style=3D'margin-left:.5in'><font size=3D3 face=3D"Times New Roman"><sp=
an
style=3D'font-size:12.0pt'>Create a new directory with the name </span></=
font><code><font
size=3D2 face=3D"Courier New"><span style=3D'font-size:10.0pt'>DIR</span>=
</font></code>.
If <code><font size=3D2 face=3D"Courier New"><span style=3D'font-size:10.=
0pt'>RECURSE</span></font></code>
is <i><span style=3D'font-style:italic'>true</span></i> then <code><font
size=3D2 face=3D"Courier New"><span style=3D'font-size:10.0pt'>mkdir</spa=
n></font></code>
will attempt to create all the directories in the given path.<o:p></o:p><=
/p>
</div>
<p><font size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0p=
t'> <o:p></o:p></span></font></p>
<p><font size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0p=
t'> <o:p></o:p></span></font></p>
<div id=3DdivRpF981374>
<div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><font s=
ize=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>
<hr size=3D2 width=3D"100%" align=3Dcenter tabindex=3D-1>
</span></font></div>
<p class=3DMsoNormal style=3D'margin-bottom:12.0pt'><b><font size=3D2 fac=
e=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma;font-weight:bol d'>From:</spa=
n></font></b><font
size=3D2 face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma=
'>
activeperl-bounces [at] listserv.ActiveState.com
[activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of zilore mumba
[zmumba [at] yahoo.com]<br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> Tuesday, December 29=
, 2009
6:00 AM<br>
<b><span style=3D'font-weight:bold'>To:</span></b> activeperl [at] listserv.ac=
tivestate.com<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> help with ftp</sp=
an></font><o:p></o:p></p>
</div>
<div>
<table class=3DMsoNormalTable border=3D0 cellspacing=3D0 cellpadding=3D0>
<tr>
<td valign=3Dtop style=3D'padding:0in 0in 0in 0in'>
<p class=3DMsoNormal style=3D'margin-bottom:12.0pt'><font size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>Hello Perl Co=
mmunity.<br>
Thanks so much for all the help provided lduring the current year.<br>
Happy and prosperous New Year 2010 to all.<br>
<br>
Below is my code where I have a problem with ftp. I am trying to transf=
er
data from one PC to another. When I try to make a directory on the dist=
ant
machine, I get the error: "Can't locate object method 'mkpath' via
package 'ftp".<br>
When I comment this part out, the same error appears later on with
"ftp->put".<br>
Both parts with problem are highlighted in yellow.<br>
<br>
I am not able to find help in Perldoc.<br>
Any help will be appreciated<br>
<br>
Zilore<br>
<br>
<br>
#!/usr/bin/perl -w<br>
#This transfers files from a  PC running LINUX to Windows PC.<br>
#<br>
use Net::FTP;<br>
<br>
use strict;<br>
use warnings;<br>
use POSIX;<br>
use File::Path;<br>
use File::Copy;<br>
<br>
my $debug =3D 1;<br>
# set variables<br>
#<br>
my $User =3D 'pc-mis';<br>
my $Pass =3D 'acmad11';<br>
my $Host =3D '192.168.2.115';<br>
<br>
my [at] models =3D ('arpege', 'ukmo', 'ecmf');<br>
my [at] now =3D localtime;<br>
my $dat =3D strftime "%Y%m%d", [at] now;<br>
my $mon_ab =3D strftime "%b", [at] now;<br>
my $mon_num =3D strftime "%m", [at] now;<br>
my $mon_name =3D strftime "%B", [at] now;<br>
my $yr=3Dstrftime "%y", [at] now;<br>
<br>
my $dash=3D"-";<br>
my $mod =3D "models";<br>
<br>
my ($day, $month, $year) =3D (localtime(time() - 60 * 60 * 24)) [ 3, 4,=
5 ];<br>
$year =3D $year+1900;<br>
$month =3D $month+1;<br>
<br>
my $dat0 =3D sprintf("%04d%02d%02d",  $year, $month, $da=
y );<br>
<br>
my $archive_dir =3D
"../ARCHIVE/$mon_num$dash$mon_name$yr";   # where d=
ata
is<br>
<br>
my $remote_basedir =3D '/';<br>
my $data_dir =3D
"ARCHIVE/$mon_num$dash$mon_name$yr/$mon_ab$yr$dash$mod"; #whe=
re
to put it<br>
<br>
my [at] localdir
=3D("../ARCHIVE/$mon_num$dash$mon_name$yr/$models[0]/$dat0",<=
br>
            =
;  
"../ARCHIVE/$mon_num$dash$mon_name$yr/$models[1]/$dat0",<br>
              
"../ARCHIVE/$mon_num$dash$mon_name$yr/$models[2]/$dat0"); <br=
>
<br>
#my [at] remotedir =3D ('$data_dir/$models[0]/$dat0','$data_dir/$models[1]/=
$dat0',<br>
#           &nbs=
p;    
'$data_dir/$models[2]/$dat0');<br>
<br>
# connect to the remote host<br>
<br>
print "Connecting to $Host ...\n";<br>
my $ftp =3D Net::FTP->new($Host, Timeout =3D> 360, Passive =3D>=
; 'true')
or fail ();<br>
    <br>
$ftp->login($User,$Pass) or die " login '$ftp'  failed: $_
($^E)";<br>
$ftp->binary;<br>
<br>
<span style=3D'background:yellow'>foreach my $ddir ( [at] remotedir) {</span=
><br>
<span style=3D'background:yellow'>    if (! -d $ddir) {<=
/span><br>
<span style=3D'background:yellow'>      &=
nbsp;
print "mkpath $ddir\n" if $debug;</span><br>
<span style=3D'background:yellow'>      &=
nbsp;
$ftp->mkpath ($ddir) or die "mkpath '$ddir' failed: $! ($^E)&qu=
ot;;</span><br>
<span style=3D'background:yellow'>   }</span><br>
<span style=3D'background:yellow'>}</span><br>
$ftp->cwd($data_dir);<br>
<br>
# transfer data<br>
<br>
print "Transfering data\n";<br>
<br>
#my %numbers =3D ('$localdirs[0]' =3D> '0','localdirs[1]' =3D>
'1','localdirs[2]' =3D> '2');<br>
<br>
my %remotedirs =3D ();<br>
my $remotedirs;<br>
    <br>
foreach my $model ( [at] models) {<br>
<br>
    # define local and remote directories before copying
files<br>
<br>
    if ($model eq 'arpege') {<br>
     my $remotedirs =3D
"$data_dir/$models[0]/$dat0";<br>
       $remotedirs{$remotedirs} =3D $localdir[=
0];<br>
<br>
  } elsif ($model eq 'ukmo') {<br>
     my $remotedirs =3D
"$data_dir/$models[1]/$dat0";<br>
       $remotedirs{$remotedirs} =3D
$localdir[1];<br>
<br>
  } elsif ($model eq 'ecmf') {<br>
     my $remotedirs =3D
"$data_dir/$models[2]/$dat0";<br>
       $remotedirs{$remotedirs} =3D
$localdir[2];<br>
  }<br>
  <br>
    # Transfer files<br>
<br>
    foreach my $rdir (keys %remotedirs) {<br>
     $ftp->cwd($remotedirs($rdir));<br>
<br>
     my $ldir =3D $remotedirs{$rdir}<br>
     <br>
     print "Transfering files from $ldir to
$remotedirs(rdir)\n" if $debug;<br>
     opendir DIR, "$ldir" or die
"opendir '$ldir: $! ($^E)";<br>
     while (my $file =3D readdir DIR) {<br>
        print "DIR";<br>
        exit;<br>
        next if $file =3D~ /\*(b|x|l=
)$/;<br>
        print "Putting
$file\n" if $debug;<br>
        <span style=3D'background:ye=
llow'>ftp->put($file)
or warn "Failed '$file': $! ($^E)";</span><br>
     }<br>
     closedir DIR;<br>
  <br>
    }<br>
}<br>
<br>
$ftp->close;<br>
print "Transfering ends\n";<br>
exit 0;<br>
<br>
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D<br>
#           &nbs=
p;            &=
nbsp;      
Subroutines<br>
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D<br>
<br>
sub fail {<br>
<br>
$ftp->quit;<br>
die "ftp error occurred\n";<br>
<br>
}<br>
<br>
<br>
__END__<br>
<br>
my $files =3D $ftp->dir() or die "Error doing ftp->dir:
$!\n";<br>
my $files =3D dir() or die "Error doing dir: $!\n";<br>
foreach ( [at] $files) {<br>
    # skip lines not starting with d or -<br>
    if (/^[^d-]/) {<br>
         print "Skipping
garbage dir line\n" if $debug;<br>
        next;<br>
    }<br>
<br>
# ftp dir listing<br>
#----0----- -1- ---2---- ---3---- ---4---- -5- -6 --7-- -----8--------<=
br>
#total 52<br>
#drwx--x---   3 owner   
group        1024 Dec 13  1997 =
..<br>
#drwxr-xr-x 671 owner   
group       49152 Dec 18 14:09 ..<br>
#-rw-r--r--   1 xyz     
httpd        2010 Sep 21 13:31 index=
..htm<br>
<br>
    my ($size, $file) =3D (split /\s+/, $_,
9)[4,8];    # get size/filename<br>
    next if $file =3D~
/^\.{1,2}$/;        # skip . and ..<=
br>
<br>
    # if directory - call directory recurse routine<br>
<br>
    if (/^d/) {<br>
        ...<br>
<br>
<o:p></o:p></span></font></p>
</td>
</tr>
</table>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'><o:p></o:p></span></font></p>
</div>
</div>
</td>
</tr>
</table>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span style=3D=
'font-size:
12.0pt'><o:p> </o:p></span></font></p>

</div>

</body>

</html>

--_000_6DFE695E783E004A9E6D2CD1E0B8CA1F0BEF0A1302bmail2bigfi xc_--

--===============1550139607==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1550139607==--
Jeff Saxton [ Di, 29 Dezember 2009 18:19 ] [ ID #2027373 ]

Re: help with ftp

--===============1641112502==
Content-Type: multipart/alternative; boundary="0-265205198-1262168634=:52161"

--0-265205198-1262168634=:52161
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Bill,
Once again thanks very much for your very comprehensive script. It will all=
ow me to learn a lot of perl also. As it is quite long, it will take me tim=
e to digest. I will let you know when it works.
Incidentally do I insert the whole code (minus the notes at the end of cour=
se -very useful notes) and remove all my code after definition of the direc=
tories below?

My appreciation for your time.
Zilore



--- On Wed, 12/30/09, Bill Luebkert <dbecoll [at] roadrunner.com> wrote:

From: Bill Luebkert <dbecoll [at] roadrunner.com>
Subject: Re: help with ftp
To: "zilore mumba" <zmumba [at] yahoo.com>
Date: Wednesday, December 30, 2009, 2:09 AM


=A0=A0=A0 my $data_dir =3D "ARCHIVE/$mon_num$dash$mon_name$yr/$mon_ab$yr$da=
sh$mod";

=A0=A0=A0 my [at] localdir =3D ( # looks like you have to run from dir parallel=
to ARCHIVE dir
=A0=A0=A0 =A0 "../ARCHIVE/$mon_num$dash$mon_name$yr/$models[0]/$dat0",
=A0=A0=A0 =A0 "../ARCHIVE/$mon_num$dash$mon_name$yr/$models[1]/$dat0",
=A0=A0=A0 =A0 "../ARCHIVE/$mon_num$dash$mon_name$yr/$models[2]/$dat0",
=A0=A0=A0 =A0 =A0=A0=A0 # would make more sense as /$yr$mon_num/ in the mid=
dle
=A0=A0=A0 );


Script (putall.pl) - cut and paste into putall.pl (or whatever):
Nope that helps some.



=0A=0A=0A
--0-265205198-1262168634=:52161
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0" ><tr><td valign=3D"=
top" style=3D"font: inherit;">Bill,<br>Once again thanks very much for your=
very comprehensive script. It will allow me to learn a lot of perl also. A=
s it is quite long, it will take me time to digest. I will let you know whe=
n it works.<br>Incidentally do I insert the whole code (minus the notes at =
the end of course -very useful notes) and remove all my code after definiti=
on of the directories below?<br><br>My appreciation for your time.<br>Zilor=
e<br><br><br><br>--- On <b>Wed, 12/30/09, Bill Luebkert <i><dbecoll [at] road=
runner.com></i></b> wrote:<br><blockquote style=3D"border-left: 2px soli=
d rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Bill Lu=
ebkert <dbecoll [at] roadrunner.com><br>Subject: Re: help with ftp<br>To: =
"zilore mumba" <zmumba [at] yahoo.com><br>Date: Wednesday, December 30, 20=
09, 2:09 AM<br><br><div class=3D"plainMail"><br>    my $data=
_dir =3D
"ARCHIVE/$mon_num$dash$mon_name$yr/$mon_ab$yr$dash$mod";<br><br> &nbs=
p;  my [at] localdir =3D ( # looks like you have to run from dir parallel =
to ARCHIVE dir<br>      "../ARCHIVE/$mon_num$dash$mon_n=
ame$yr/$models[0]/$dat0",<br>      "../ARCHIVE/$mon_num=
$dash$mon_name$yr/$models[1]/$dat0",<br>      "../ARCHI=
VE/$mon_num$dash$mon_name$yr/$models[2]/$dat0",<br>     =
;     # would make more sense as /$yr$mon_num/ in the middle=
<br>    );<br><br><br>Script (putall.pl) - cut and paste int=
o putall.pl (or whatever):<br>Nope that helps some.<br><br><br><br></div></=
blockquote></td></tr></table><br>=0A=0A
--0-265205198-1262168634=:52161--

--===============1641112502==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1641112502==--
zilore mumba [ Mi, 30 Dezember 2009 11:23 ] [ ID #2027472 ]

Re: help with ftp

--===============0087656248==
Content-Type: multipart/alternative; boundary="0-1303611429-1262192169=:81485"

--0-1303611429-1262192169=:81485
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Bill,
Once again thanks very much for your very comprehensive script. It will all=
ow me to learn a lot of perl also. As it is quite long, it will take me tim=
e to digest. I will let you know when it works.
Incidentally do I insert the whole code (minus the notes at the end of cour=
se -very useful notes) and remove all my code after definition of the direc=
tories below?

My appreciation for your time.
Zilore



--- On Wed, 12/30/09, Bill Luebkert <dbecoll [at] roadrunner.com> wrote:

From: Bill Luebkert <dbecoll [at] roadrunner.com>
Subject: Re: help with ftp
To: "zilore mumba" <zmumba [at] yahoo.com>
Date: Wednesday, December 30, 2009, 2:09 AM


=A0=A0=A0 my $data_dir =3D "ARCHIVE/$mon_num$dash$mon_name$yr/$mon_ab$yr$da=
sh$mod";

=A0=A0=A0 my [at] localdir =3D ( # looks like you have to run from dir parallel=
to ARCHIVE dir
=A0=A0=A0 =A0 "../ARCHIVE/$mon_num$dash$mon_name$yr/$models[0]/$dat0",
=A0=A0=A0 =A0 "../ARCHIVE/$mon_num$dash$mon_name$yr/$models[1]/$dat0",
=A0=A0=A0 =A0 "../ARCHIVE/$mon_num$dash$mon_name$yr/$models[2]/$dat0",
=A0=A0=A0 =A0 =A0=A0=A0 # would make more sense as /$yr$mon_num/ in the mid=
dle
=A0=A0=A0 );


Script (putall.pl) - cut and paste into putall.pl (or whatever):
Nope that helps some.



=0A=0A=0A
--0-1303611429-1262192169=:81485
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0" ><tr><td valign=3D"=
top" style=3D"font: inherit;">Bill,<br>Once again thanks very much for your=
very comprehensive script. It will allow me to learn a lot of perl also. A=
s it is quite long, it will take me time to digest. I will let you know whe=
n it works.<br>Incidentally do I insert the whole code (minus the notes at =
the end of course -very useful notes) and remove all my code after definiti=
on of the directories below?<br><br>My appreciation for your time.<br>Zilor=
e<br><br><br><br>--- On <b>Wed, 12/30/09, Bill Luebkert <i><dbecoll [at] road=
runner.com></i></b> wrote:<br><blockquote style=3D"border-left: 2px soli=
d rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Bill Lu=
ebkert <dbecoll [at] roadrunner.com><br>Subject: Re: help with ftp<br>To: =
"zilore mumba" <zmumba [at] yahoo.com><br>Date: Wednesday, December 30, 20=
09, 2:09 AM<br><br><div class=3D"plainMail"><br>    my $data=
_dir =3D
"ARCHIVE/$mon_num$dash$mon_name$yr/$mon_ab$yr$dash$mod";<br><br> &nbs=
p;  my [at] localdir =3D ( # looks like you have to run from dir parallel =
to ARCHIVE dir<br>      "../ARCHIVE/$mon_num$dash$mon_n=
ame$yr/$models[0]/$dat0",<br>      "../ARCHIVE/$mon_num=
$dash$mon_name$yr/$models[1]/$dat0",<br>      "../ARCHI=
VE/$mon_num$dash$mon_name$yr/$models[2]/$dat0",<br>     =
;     # would make more sense as /$yr$mon_num/ in the middle=
<br>    );<br><br><br>Script (putall.pl) - cut and paste int=
o putall.pl (or whatever):<br>Nope that helps some.<br><br><br><br></div></=
blockquote></td></tr></table><br>=0A=0A
--0-1303611429-1262192169=:81485--

--===============0087656248==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0087656248==--
zilore mumba [ Mi, 30 Dezember 2009 17:56 ] [ ID #2027473 ]
Perl » gmane.comp.lang.perl.active-perl » help with ftp

Vorheriges Thema: vidhut singh wants to stay in touch on LinkedIn
Nächstes Thema: How to Assess code coverage of both perl scripts and modules