That's not how system works. There's a parallel, persistent, universe going on in which you can make calls back and forth. You're first system starts another process, and executes ftp -n 127.0.0.1 in that. Your second system create another process, and attempts to execute the command pass root xxxxxx, and the third create yet another program, to execute quit.
in reply to system call to ftp
i dont want to use Net::FTP or any packages
In that case, open a socket to the FTP port, and implement the FTP protocol yourself.
I'm not going to help you with that. Asking for help but not willing to use packages is like asking for help to write a resume -- but one that doesn't use the letters 'e', 'a' or 'o'.