Re: NET::FTP Package
by dree (Monsignor) on Nov 21, 2002 at 15:02 UTC
|
| [reply] |
Re: NET::FTP Package
by insensate (Hermit) on Nov 21, 2002 at 15:02 UTC
|
If you're looking for the ppm package...try here...
Make sure you get the correct version... If you're using 5.8, see this thread. | [reply] |
Re: NET::FTP Package
by dree (Monsignor) on Nov 21, 2002 at 15:25 UTC
|
| [reply] |
Re: NET::FTP Package
by Zitoune (Beadle) on Nov 21, 2002 at 15:43 UTC
|
use Net::FTP;
$G_FTP_SITE = &Config_Get("TOTAL_CARE FTP_SITE");
$G_FTP_USERNAME = &Config_Get("TOTAL_CARE FTP_USERNAME");
$G_FTP_PASSWORD = &Config_Get("TOTAL_CARE FTP_PASSWORD");
$ftp = Net::FTP->new( "$G_FTP_SITE" );
$ftp->login( "$G_FTP_USERNAME","$G_FTP_PASSWORD" );
$ftp->binary ();
$ftp->put( "file.txt" );
$ftp->quit;
| [reply] [d/l] |
|
Use strict. And trap for errors:
use strict;
my $ftp = Net::FTP->new( "$G_FTP_SITE" ) or die "Can't connect: $!";
$ftp->login( "$G_FTP_USERNAME","$G_FTP_PASSWORD" ) or die "Can't login
+: $!;
$ftp->binary () or die "Can't set mode to bin: $!";
| [reply] [d/l] |
Re: NET::FTP Package
by AcidHawk (Vicar) on Nov 21, 2002 at 15:21 UTC
|
| [reply] |
Re: NET::FTP Package
by Zitoune (Beadle) on Nov 21, 2002 at 15:25 UTC
|
I'm under Perl 5 ;-)
And i remember the package name was NET::FTP and not NET::FTP::Common :-)
Any other suggestion ?? | [reply] |
Re: NET::FTP Package
by Zitoune (Beadle) on Nov 21, 2002 at 16:10 UTC
|
This the error giving to me when he's dying ( CANT CONNECT )
BAD FILE DESCRIPTOR
any idea ?? | [reply] |
|
perl -v
output, of both machines. | [reply] [d/l] |
|
Bad file descriptor is weird... can you verify that the variable being passed into the constructor represents a valid host...i.e. print the variable and ping the host to make sure it's reachable from the machine. Also, try:
my $ftp = Net::FTP->new( "$G_FTP_SITE" ) or die "Can't connect: $@";
instead to get a more accurate error message. | [reply] [d/l] |
|
when i'm printing the $@ it's printing nothing just the CANT CONNECT
| [reply] |
|
      any idea ??
One machine can see  "$G_FTP_SITE",  and the other can't?
  p
| [reply] [d/l] |
Re: NET::FTP Package
by Zitoune (Beadle) on Nov 21, 2002 at 16:47 UTC
|
FIRST MACHINE :
This is perl, version 5.005_03 built for MSWin32-x86-object
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-1999, Larry Wall
Binary build 520 provided by ActiveState Tool Corp. http://www.ActiveState.com
Built 17:55:54 Sep 28 1999
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
SECOND MACHINE
This is perl, version 5.005_03 built for MSWin32-x86-object
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-1999, Larry Wall
Binary build 520 provided by ActiveState Tool Corp. http://www.ActiveState.com
Built 17:55:54 Sep 28 1999
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
| [reply] |
Re: NET::FTP Package
by Zitoune (Beadle) on Nov 21, 2002 at 16:54 UTC
|
So it's the same version and on one it's working and the other one it's not.
I'm sure it's the package but where i found it :-( can't remember | [reply] |
|
ppm verify --upgrade libnet
then you can type
perl -MNet::FTP -e "print $Net::FTP::VERSION"
to verify if the module works.
HTH | [reply] [d/l] [select] |
Re: NET::FTP Package
by Zitoune (Beadle) on Nov 21, 2002 at 15:29 UTC
|
That's what i taught but i installed the library libnet
and it's still doesn't work :-( | [reply] |
|
| [reply] |
|
Please post some code and the errors you are encountering?
| [reply] |
Re: NET::FTP Package
by Zitoune (Beadle) on Nov 21, 2002 at 15:38 UTC
|
I'm on my machine and i can execute my code correctly.
When i'm trying to run it on another machine,it says that i can call the method login.
I remember installed a package name NET::FTP
on my machine and i delete the zip by accident :-(
| [reply] |
|
Verify that the module is installed:
Run this from the commandline...it'll print "ok" if the module is installed and complain about not finding the module if it's not.
perl -MNet::FTP -e"print 'ok'"
If the module is, in fact, installed....Are you sure the exact identical script works on the other machine? Are the versions of Perl the same? (use perl -v to find the version)...And if all of that is fine please post your code. | [reply] [d/l] |
Re: NET::FTP Package
by Zitoune (Beadle) on Nov 21, 2002 at 15:50 UTC
|
i try this line (perl -MNet::FTP -e"print 'ok'")
on my other machine and it print ok
But i still cannot excute my script on it
It's the same version on both machine
| [reply] [d/l] |
Re: NET::FTP Package
by Zitoune (Beadle) on Nov 21, 2002 at 18:36 UTC
|
Both can see all variable
the version for both NET::FTP is the same 2.33.
And my libnet is up to date | [reply] |
Re: NET::FTP Package
by Zitoune (Beadle) on Nov 21, 2002 at 15:10 UTC
|
Why are you giving me ActiveState links when i said in my thread that i already look there and couldn't find it.
Anywhere else ??? | [reply] |
Re: NET::FTP Package
by Zitoune (Beadle) on Nov 21, 2002 at 18:38 UTC
|
| [reply] |