hi again,
actually I do already have a login, just too lazy to login! :-)

OK, the code I have is as follows, but it's just a simple test thing to try and get FTP.pm to work.

#!/usr/bin/perl -w

use Net::FTP;

my $hostname='216.74.109.245';
my $user='username';
my $password='password';
my $ftp=Net::FTP -> new($hostname) or die ("Connect failed");
$ftp->login($username,$password) or die ("Cant log in");
$ftp->binary;
$ftp->cwd("/public_ftp") or die ("Cant change directory");
$ftp->put("mystuff.txt") or die ("Cant put stuff on server");
$ftp->quit

It produces:
Name "main::username" used only once: possible typo at ./ftp-logs.pl line 9.
Cant log in at ./ftp-logs.pl line 9.

However, I am pretty sure my login information is correct and I can connect via the unix FTP prompt fine.

I'm also slightly concerned whether it's working ok because I had to manually create the Net::Config.pm file by copying it from cpan because it didn't exist in my system originally, but was required by the Net::FTP.pm module.

Hmm i'm confused...
thanks,
Tom


In reply to Re: Re: FTP Unix -> NT by shaolin_gungfu
in thread FTP Unix -> NT by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.