I'm kind of confused. It sounds like you want to automate telneting into a server and deleting some files, but in your example, you say "$ftp" (which presumably isn't a telnet object) and "system" (which deletes files on your local system, not on a remote one).
Perhaps you want to look at using Net::Telnet's cmd method?