in reply to ftp remote-editing script

I like this code. I have three suggestions:

  1. I'd make $firsttime an explicit package variable (refer to it as $main::firsttime) rather than a top-level lexical. After the top-level while loop, you don't refer to it for a long time, and its appearance in checkfile is a bit disorienting.
  2. Instead of running words together in symbol names, I'd separate them with underscores (so $firsttime would become $first_time). This is quite subjective, but I find it much easier to read.
  3. The massive if...elsif...elsif...else statement in sub ftp is ugly. :-) I'd use a dispatch table instead:
    my %commands = ( 'LS' => \&lsftp, 'DIR' => \&dirftp, 'GET' => \&getftp, 'PUT' => \&putftp, 'DEL' => \&delftp, 'SIZE' => \&sizeftp, ); [...] my $cmd = $commands{$type}; if(&$cmd($value1, $value2) == 1) { sleep $idletime; next; }

    It would take a little bit of work to make the interfaces for each command sub identical (or at least compatible), but I think the savings are worth it.

--
The hell with paco, vote for Erudil!
:wq