It's certainly possible to roll your own code for an ftp client, but given the complexity of the task and the learning curve of getting it right, why? There are a plethora of modules available on CPAN for almost any situation in the ftp client arena.
If you really want to do it yourself, you're going to have to start reading the ftp rfcs, and work with raw sockets, I think.