in reply to copy is not happening using

In addition to Corion's comments, note that Device::SerialPort supports a "lookfor" method that can be used to "look for" certain strings like a command prompt and react to them. However, I would suggest you look at Expect as an alternative, which can be used together with IO::Termios instead of Device::SerialPort. I wrote about this (with examples) in Lower-Level Serial Port Access on *NIX.