in reply to ftp remote-editing script
I like this code. I have three suggestions:
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
|
|---|