ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-users
perl-win32-users
RE: :FTP pasv_xfer() using problem
by Brian Raven other posts by this author
Jun 18 2009 7:30AM messages near this date
view in the new Beta List Site
Net::FTP pasv_xfer() using problem | LWP Help
From: perl-win32-users-bounces@[...].com
[mailto:perl-win32-users-bounces@[...].com] On Behalf Of
Kprasad
Sent: 18 June 2009 14:52
To: perl-win32-users@[...].com
Subject: Net::FTP pasv_xfer() using problem

>  Hi
>   
>  Please provide solution for below mentioned problem, message showing
while executing below mentioned script
>   
>  CODE:
>   
>  #!/usr/bin/perl 

The first thing wrong with your code is the absence of "use strict;" and
"use warnings;" at the start.

>  use Net::FTP;
>  use File::stat;
>  ##I'm hoping to use pasv_xfer(sourcefile, dest_server) to do a server
to server passive transfer

Here's a clue ..............................^^^^^^^^^^^

>   
>  $ftpout = Net::FTP->new("192.168.180.188", Debug => 0)
>      or die "Cannot connect to 192.168.180.188: $@"; #destination
server
>        $ftpout->login("tj","tj") or die "Cannot login ",
$ftpout-> message;
>      warn "Failed to set binary mode\n" unless $ftpout->binary();
>      $pwddirout=$ftpout->pwd();
>      $ftpdest="$pwddirout/training";
>      print "Destination Directory $ftpdest\n";
>      
>     $ftpin = Net::FTP->new("192.168.180.192", Debug => 0)
>      or die "Cannot connect to 192.168.180.192: $@"; #source server
>   $ftpin->login("iop123","iop312") or die "Cannot login ",
$ftpin-> message;
>   
>   $pwddir=$ftpin->pwd();
>   warn "Failed to set binary mode\n" unless $ftpin->binary();
>   $ftpin->pasv_xfer("ApJ306023.xml", $ftpdest);

You haven't specified the destination server. Perhaps $ftpout?

>   $lsize = stat("c:/temp/apj_697_1_106ej.zip")->size;
>   print "SIZE:- $lsize";
>   $ftpout->quit() or die "FTP: Couldn't quit.";
>   $ftpin->quit() or die "FTP: Couldn't quit.";
>  
>   
>  MESSAGE: Can't call method "port" without a package or object
reference at C:/Perl/lib/Ne
>  t/FTP.pm line 1122.

HTH

-- 
Brian Raven 
This e-mail may contain confidential and/or privileged information. If you are not the inten
ded recipient or have received this e-mail in error, please advise the sender immediately by
 reply e-mail and delete this message and any attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this e-mail is stric
tly forbidden.

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Kprasad
Brian Raven

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved