Found out that if an EOF error happens the command returns 0, $ftp->code() returns 0, and $ftp->message() returns "", so here's a way around it which I'm posting if it'll help anyone else...

It returns 1000 on an EOF and the routine that calls it thinks it's an unrecoverable FTP error as it's above 500 and quits.

Cheers.

sub ftp_move() { my $file=$_[0]; my $exempt=-1; my $code; $exempt=$_[0] if $_[0]; if(-e $rvf_incoming.$file.".done") { &write_log("+ [$file] already exists in incoming direc +tory, skipping",0); $files_skipped++; return 0; } &write_log("+ [$file] interesting name, moving to incoming dir +ectory.",0); if($ftp->get($file,$rvf_incoming.$file)) { # Don't bother about errors, may not have permission t +o delete. ### TEMPORARY ### $ftp->delete($file); open(DONE,">".$rvf_incoming.$file.".done"); close(DONE); $files_moved++; return 0; } $code=$ftp->code(); if($code==0 && $@ eq "") { &write_log("! error, unexpected EOF on command channel +",0); return 1000; } if($code>=400) { if($code!=$exempt) { &write_log("| [$file] error moving from FTP si +te - ".$code." $@",0); $files_error++; } return $code; } return 0; }

In reply to Re: Re: Re: (tye)Re: NET::FTP - Unexpected EOF on command channel by Anonymous Monk
in thread NET::FTP - Unexpected EOF on command channel 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.