Sandeep TR wrote:
> hello,
Hi Sandeep
> my $FTP = Net::FTP::Common->new(\%FTP_Config, \%Common_cfg);
> &Debug($FTP);
> my $Host = "192.168.1.1";
> my ($SrcFile, $CopyOp,$Error, $ConfFile);
here, you are calling Debug() before $HOST is defined. I don't see how $HOST can
get defined. If you include the complete program, that might be better.
also, does this program use strict and use warnings?
most perl programs should do that
>
> # can we login to the machine?
> print "Attempting to access host: $Host\r\n";
> if (! $FTP->login($Host)) {
*** THIS IS YOUR PROBLEM ***
You called $FTP->login($Host)
The Net::FTP::Common login() function expects a hash to be supplied or no
arguments to be supplied, not a scalar. Perhaps you meant to use Net::FTP and
not Net::FTP::Common?
if you use Net::FTP::Common, then you need to do this:
if (! $FTP->login()) {
or you can do this:
if (! $FTP->login(Host => $Host)) {
> $Error = "Error, access device at $Host check cables and make sure
> device is defaulted";
> &ReturnResults($Error);
> &Debug($Error);
> die $Error;
> }
> ....
> ...
> ....
> }
>
>
> *when i run this program i get the error as :- *
>
> Release IP Address for TestNIC
> Renew IP Address for TestNIC
> Attempting to access host: 192.168.1.1
Interesting, $HOST is defined. I don't see how it could've been defined based on
the script that I saw.
> Net::FTP>>> Net::FTP(2.72)
> Net::FTP>>> Exporter(5.562)
> Net::FTP>>> Net::Cmd(2.24)
> Net::FTP>>> IO::Socket::INET(1.25)
> Net::FTP>>> IO::Socket(1.26)
> Net::FTP>>> IO::Handle(1.21)
> Net::FTP: Unexpected EOF on command channel at zyxel.pl line 43
> FATAL: attempt to create Net::FTP session failed.
> Most likely reason for this is lack of internet connectivity.
Please install the attached version of Net::FTP::Common. It has better
debugging. I just uploaded it to CPAN.
>
>
> I am still new to this filed, i belive they are many
> people in this group with expertise in this field can some one help me
> out of this situation, its critical for me to get this thing going.
>
Don't worry. We'll help you out :)