|
Posted by Michael Greb on February 28, 2006, 4:04 am
Please log in for more thread options
Notice how my reply quotes your message and says which message I am
replying too? You can do this by clicking the options or details link
at the top and then selecting reply there.
> #!/usr/bin/perl -w
use strict; # you were missing this
use warnings; # it's better to use warnings rather
# then call perl with -w
> use Net::FTP;
>
> $ftp=Net::FTP->new($host)
> or die("cannot establish ftp connection with $host");
>
> $ftp->login("","");
>
> $ftp->cwd("/");
> $ftp->cwd("/etc/init.d");
>
> @lines=$ftp->pwd();
> print "\n\nCurrent Directory is @lines"; // this gives the correct
> current directory
I'm not very familiar with this module as I've never used it but
wouldn't a scalar be more appropriate? Does $ftp->pwd() actually return
a list? Also, # is the comment character in perl, not //
>
> $ftp->put("start","startup");
Replace this with:
$ftp->put('start', 'startup')
or die 'Put failed: ', $ftp->message, "\n";
This should give you some useful diagnostic output.
> i have typed this code .. if i am using get i.e. getting a file from
> the remote machine it is working properly ..
--
Michael
michael@thegrebs.com
|