Hi, I don't know anything about your requirement or telnet prompts, but your question seems to be one about basic software design.
You should write a module named something like MyConnect.pm containing the code that is used for all cases. Then you should write subclasses like MyConnect/SomeDevice.pm and MyConnect/OtherDevice.pm which contain the functions that are specific to each case. Then use the appropriate subclass in each case.
See perlmod and many other resources, e.g. https://perlmaven.com/how-to-create-a-perl-module-for-code-reuse.
In reply to Re: How to give prompt
by 1nickt
in thread How to give prompt
by vasanth.easyrider
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |