hi Roy

thanks for your time and help
about your question:
I have to send the first file in each cases.
after 20 minutes sleep I have to check if the first file is still on the remote server in $remote_directory_1 or not.
only if the first file is not there (in $remote_directory_1), I can send the second file.

I changed the code :
...................................................................... +. # ftp transfer my $ftp = Net::FTP->new ($server, Timeout => 9000, Debug => 3) +; $ftp or die "$server: cannot connect: $@"; # If you don't use ~/.netrc $ftp->login ($user,$password) or die "$_: cannot logon: " . $ftp->message; # change remote directory for the first file $ftp->cwd($destination); # Send file to ftp server $ftp->put($new) or die "$server: cannot put $new: " . $ftp->message; #Quit FTP When finished $ftp->quit; # Sleep for 20 minutes before processing next file. sleep (20 * 60) $ftp = Net::FTP->new ($server, Timeout => 9000, Debug => 3); # + (this is 172 line) $ftp or die "$server: cannot connect: $@"; # If you don't use ~/.netrc $ftp->login ($user,$password) or die "$_: cannot logon: " . $ftp->message; # change remote directory for the first file $ftp->cwd($destination); # # this is new my $found = grep /\Q$new\E/, $ftp->ls; if ($found) { die "The file is still there!\n" } ...................................................................... +... # ftp transfer
but I get following error:
"Scalar found where operator expected at send.cgi line 172, near ")
$ftp"
(Missing operator before $ftp?)
syntax error at ftp5.cgi line 172, near ")
$ftp "
Execution of ftp5.cgi aborted due to compilation errors."

the 172 line is:
$ftp = Net::FTP->new ($server, Timeout => 9000, Debug => 3); # (this is 172 line)

any idea what could be wrong ?

kind regards
cc

In reply to Re^2: need help with FTP script by cc
in thread need help with FTP script by cc

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.