http://www.perlmonks.org?node_id=729848


in reply to Setting $telnet->prompt()

In general there is no way to do that, since the user's prompt could be null, or identical to some of the output from the commands you want to run, or... anything. On the other hand, if the shell is sh or bash-like, you can set PS1 to any string you like to change the prompt:
weirduser@localhost's password: weirdprompt;-} PS1="my_prompt> " my_prompt>